@@ -134,17 +134,17 @@ describe('uiSortable', function() {
134
134
li . simulate ( 'drag' , { dy : dy } ) ;
135
135
expect ( $rootScope . items . map ( function ( x ) { return x . text ; } ) ) . toEqual ( [ "One" , "Three" , "Four" , "Two" ] ) ;
136
136
137
- // // fails on angular 1.2
138
- // li = element.find(':eq(2)');
139
- // dy = -(2 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
140
- // li.simulate('drag', { dy: dy });
141
- // expect($rootScope.items.map(function(x){ return x.text; })).toEqual(["Four", "One", "Three", "Two"]);
142
-
143
- // // fails on angular 1.2
144
- // li = element.find(':eq(3)');
145
- // dy = -(2 + EXTRA_DY_PERCENTAGE) * li.outerHeight();
146
- // li.simulate('drag', { dy: dy });
147
- // expect($rootScope.items.map(function(x){ return x.text; })).toEqual(["Four", "Two", "One", "Three"]);
137
+ // fails on angular 1.2
138
+ li = element . find ( ':eq(2)' ) ;
139
+ dy = - ( 2 + EXTRA_DY_PERCENTAGE ) * li . outerHeight ( ) ;
140
+ li . simulate ( 'drag' , { dy : dy } ) ;
141
+ expect ( $rootScope . items . map ( function ( x ) { return x . text ; } ) ) . toEqual ( [ "Four" , "One" , "Three" , "Two" ] ) ;
142
+
143
+ // fails on angular 1.2
144
+ li = element . find ( ':eq(3)' ) ;
145
+ dy = - ( 2 + EXTRA_DY_PERCENTAGE ) * li . outerHeight ( ) ;
146
+ li . simulate ( 'drag' , { dy : dy } ) ;
147
+ expect ( $rootScope . items . map ( function ( x ) { return x . text ; } ) ) . toEqual ( [ "Four" , "Two" , "One" , "Three" ] ) ;
148
148
149
149
// also placing right above the locked node seems a bit harder !?!?
150
150
@@ -165,13 +165,15 @@ describe('uiSortable', function() {
165
165
166
166
host . append ( elementTop ) . append ( elementBottom ) ;
167
167
168
+ // fails on angular 1.2
168
169
var li1 = elementTop . find ( ':eq(0)' ) ;
169
170
var li2 = elementBottom . find ( ':eq(0)' ) ;
170
171
var dy = EXTRA_DY_PERCENTAGE * li1 . outerHeight ( ) + ( li2 . position ( ) . top - li1 . position ( ) . top ) ;
171
172
li1 . simulate ( 'drag' , { dy : dy } ) ;
172
173
expect ( $rootScope . itemsTop ) . toEqual ( [ "Top Two" , "Top Three" ] ) ;
173
174
expect ( $rootScope . itemsBottom ) . toEqual ( [ "Bottom One" , "Top One" , "Bottom Two" , "Bottom Three" ] ) ;
174
175
176
+ // fails on angular 1.2
175
177
li1 = elementBottom . find ( ':eq(1)' ) ;
176
178
li2 = elementTop . find ( ':eq(1)' ) ;
177
179
dy = - EXTRA_DY_PERCENTAGE * li1 . outerHeight ( ) - ( li1 . position ( ) . top - li2 . position ( ) . top ) ;
0 commit comments