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

Commit da50789

Browse files
committed
Merge pull request #220 from thgreasi/jqui1.11upgrade
refactor(tests): tweak tests to support jquery-ui v1.11
2 parents 3d000ec + f814933 commit da50789

7 files changed

+261
-212
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"dependencies": {
1919
"angular": "~1.2.x",
20-
"jquery-ui": ">=1.9 <1.11"
20+
"jquery-ui": ">=1.9"
2121
},
2222
"devDependencies": {
2323
"angular-mocks": "~1.2.x",

test/karma.conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ module.exports = function(config) {
3030
'src/sortable.js',
3131
'test/sortable.test-helper.js',
3232
'test/sortable.test-directives.js',
33-
'test/*.spec.js'
33+
'test/*.spec.js',
34+
'test/sortable.tests.css'
3435
]),
3536

3637

test/sortable.e2e.callbacks.spec.js

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -105,69 +105,6 @@ describe('uiSortable', function() {
105105
});
106106
});
107107

108-
it('should cancel sorting of nodes that contain "Two"', function() {
109-
inject(function($compile, $rootScope) {
110-
var elementTop, elementBottom;
111-
elementTop = $compile('<ul ui-sortable="opts" class="cross-sortable" ng-model="itemsTop"><li ng-repeat="item in itemsTop" id="s-top-{{$index}}">{{ item }}</li></ul>')($rootScope);
112-
elementBottom = $compile('<ul ui-sortable="opts" class="cross-sortable" ng-model="itemsBottom"><li ng-repeat="item in itemsBottom" id="s-bottom-{{$index}}">{{ item }}</li></ul>')($rootScope);
113-
$rootScope.$apply(function() {
114-
$rootScope.itemsTop = ['Top One', 'Top Two', 'Top Three'];
115-
$rootScope.itemsBottom = ['Bottom One', 'Bottom Two', 'Bottom Three'];
116-
$rootScope.opts = {
117-
connectWith: '.cross-sortable',
118-
update: function(e, ui) {
119-
if (ui.item.scope() &&
120-
(typeof ui.item.scope().item === 'string') &&
121-
ui.item.scope().item.indexOf('Two') >= 0) {
122-
ui.item.sortable.cancel();
123-
}
124-
}
125-
};
126-
});
127-
128-
host.append(elementTop).append(elementBottom);
129-
130-
var li1 = elementTop.find(':eq(1)');
131-
var li2 = elementBottom.find(':eq(0)');
132-
var dy = EXTRA_DY_PERCENTAGE * li1.outerHeight() + (li2.position().top - li1.position().top);
133-
li1.simulate('drag', { dy: dy });
134-
expect($rootScope.itemsTop).toEqual(['Top One', 'Top Two', 'Top Three']);
135-
expect($rootScope.itemsBottom).toEqual(['Bottom One', 'Bottom Two', 'Bottom Three']);
136-
expect($rootScope.itemsTop).toEqual(listContent(elementTop));
137-
expect($rootScope.itemsBottom).toEqual(listContent(elementBottom));
138-
139-
li1 = elementBottom.find(':eq(1)');
140-
li2 = elementTop.find(':eq(1)');
141-
dy = -EXTRA_DY_PERCENTAGE * li1.outerHeight() - (li1.position().top - li2.position().top);
142-
li1.simulate('drag', { dy: dy });
143-
expect($rootScope.itemsTop).toEqual(['Top One', 'Top Two', 'Top Three']);
144-
expect($rootScope.itemsBottom).toEqual(['Bottom One', 'Bottom Two', 'Bottom Three']);
145-
expect($rootScope.itemsTop).toEqual(listContent(elementTop));
146-
expect($rootScope.itemsBottom).toEqual(listContent(elementBottom));
147-
148-
li1 = elementTop.find(':eq(0)');
149-
li2 = elementBottom.find(':eq(0)');
150-
dy = EXTRA_DY_PERCENTAGE * li1.outerHeight() + (li2.position().top - li1.position().top);
151-
li1.simulate('drag', { dy: dy });
152-
expect($rootScope.itemsTop).toEqual(['Top Two', 'Top Three']);
153-
expect($rootScope.itemsBottom).toEqual(['Bottom One', 'Top One', 'Bottom Two', 'Bottom Three']);
154-
expect($rootScope.itemsTop).toEqual(listContent(elementTop));
155-
expect($rootScope.itemsBottom).toEqual(listContent(elementBottom));
156-
157-
li1 = elementBottom.find(':eq(1)');
158-
li2 = elementTop.find(':eq(1)');
159-
dy = -EXTRA_DY_PERCENTAGE * li1.outerHeight() - (li1.position().top - li2.position().top);
160-
li1.simulate('drag', { dy: dy });
161-
expect($rootScope.itemsTop).toEqual(['Top Two', 'Top One', 'Top Three']);
162-
expect($rootScope.itemsBottom).toEqual(['Bottom One', 'Bottom Two', 'Bottom Three']);
163-
expect($rootScope.itemsTop).toEqual(listContent(elementTop));
164-
expect($rootScope.itemsBottom).toEqual(listContent(elementBottom));
165-
166-
$(elementTop).remove();
167-
$(elementBottom).remove();
168-
});
169-
});
170-
171108
it('should update model from update() callback', function() {
172109
inject(function($compile, $rootScope) {
173110
var element, logsElement;

0 commit comments

Comments
 (0)