Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 49b4f9e

Browse files
committed
test(callbacks): try canceled sortings more that once
1 parent b26aa64 commit 49b4f9e

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

Diff for: test/sortable.e2e.callbacks.spec.js

+24
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ describe('uiSortable', function() {
6868
li.simulate('drag', { dy: dy });
6969
expect($rootScope.items).toEqual(['One', 'Two', 'Three']);
7070
expect($rootScope.items).toEqual(listContent(element));
71+
// try again
72+
li = element.find('[ng-repeat]:eq(1)');
73+
dy = (1 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
74+
li.simulate('drag', { dy: dy });
75+
expect($rootScope.items).toEqual(['One', 'Two', 'Three']);
76+
expect($rootScope.items).toEqual(listContent(element));
77+
// try again
78+
li = element.find('[ng-repeat]:eq(1)');
79+
dy = (1 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
80+
li.simulate('drag', { dy: dy });
81+
expect($rootScope.items).toEqual(['One', 'Two', 'Three']);
82+
expect($rootScope.items).toEqual(listContent(element));
7183

7284
li = element.find('[ng-repeat]:eq(0)');
7385
dy = (2 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
@@ -174,6 +186,18 @@ describe('uiSortable', function() {
174186
li.simulate('drag', { dy: dy });
175187
expect($rootScope.items).toEqual(['One', 'Two', 'Three']);
176188
expect($rootScope.items).toEqual(listContent(element));
189+
// try again
190+
li = element.find('[ng-repeat]:eq(1)');
191+
dy = (1 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
192+
li.simulate('drag', { dy: dy });
193+
expect($rootScope.items).toEqual(['One', 'Two', 'Three']);
194+
expect($rootScope.items).toEqual(listContent(element));
195+
// try again
196+
li = element.find('[ng-repeat]:eq(1)');
197+
dy = (1 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
198+
li.simulate('drag', { dy: dy });
199+
expect($rootScope.items).toEqual(['One', 'Two', 'Three']);
200+
expect($rootScope.items).toEqual(listContent(element));
177201

178202
li = element.find('[ng-repeat]:eq(0)');
179203
dy = (2 + EXTRA_DY_PERCENTAGE) * li.outerHeight();

0 commit comments

Comments
 (0)