diff options
Diffstat (limited to 'library/Sortable/tests/Sortable.compat.test.js')
-rw-r--r-- | library/Sortable/tests/Sortable.compat.test.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/library/Sortable/tests/Sortable.compat.test.js b/library/Sortable/tests/Sortable.compat.test.js new file mode 100644 index 000000000..7c00396b9 --- /dev/null +++ b/library/Sortable/tests/Sortable.compat.test.js @@ -0,0 +1,39 @@ +import { Selector } from 'testcafe'; + + +fixture `Simple Sorting` + .page `./single-list.html`; + +let list1 = Selector('#list1'); + +test('Sort down list', async browser => { + const dragStartPosition = list1.child(0); + const dragEl = await dragStartPosition(); + const dragEndPosition = list1.child(2); + const targetStartPosition = list1.child(2); + const target = await targetStartPosition(); + const targetEndPosition = list1.child(1); + + await browser + .expect(dragStartPosition.innerText).eql(dragEl.innerText) + .expect(targetStartPosition.innerText).eql(target.innerText) + .dragToElement(dragEl, target) + .expect(dragEndPosition.innerText).eql(dragEl.innerText) + .expect(targetEndPosition.innerText).eql(target.innerText); +}); + +test('Sort up list', async browser => { + const dragStartPosition = list1.child(2); + const dragEl = await dragStartPosition(); + const dragEndPosition = list1.child(0); + const targetStartPosition = list1.child(0); + const target = await targetStartPosition(); + const targetEndPosition = list1.child(1); + + await browser + .expect(dragStartPosition.innerText).eql(dragEl.innerText) + .expect(targetStartPosition.innerText).eql(target.innerText) + .dragToElement(dragEl, target) + .expect(dragEndPosition.innerText).eql(dragEl.innerText) + .expect(targetEndPosition.innerText).eql(target.innerText); +}); |