Skip to content

Commit d85b016

Browse files
mikesherovscottgonzalez
authored andcommitted
Dev: Standardized the resizable test suite. Fixed #8754 - Dev: Get resizable test suite to pass
1 parent 8746042 commit d85b016

File tree

8 files changed

+99
-99
lines changed

8 files changed

+99
-99
lines changed

build/tasks/testswarm.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var versions = {
2121
"Menu": "menu/menu.html",
2222
"Position": "position/position.html",
2323
"Progressbar": "progressbar/progressbar.html",
24-
//"Resizable": "resizable/resizable.html",
24+
"Resizable": "resizable/resizable.html",
2525
"Selectable": "selectable/selectable.html",
2626
//"Slider": "slider/slider.html",
2727
//"Sortable": "sortable/sortable.html",

grunt.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ grunt.initConfig({
281281
files: grunt.file.expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
282282
// disabling everything that doesn't (quite) work with PhantomJS for now
283283
// TODO except for all|index|test, try to include more as we go
284-
return !( /(all|all-active|index|test|resizable|sortable|dialog|slider|datepicker|tabs|tooltip)\.html$/ ).test( file );
284+
return !( /(all|all-active|index|test|sortable|dialog|slider|datepicker|tabs|tooltip)\.html$/ ).test( file );
285285
})
286286
},
287287
lint: {
288288
ui: grunt.file.expandFiles( "ui/*.js" ).filter(function( file ) {
289289
// TODO remove items from this list once rewritten
290-
return !( /(mouse|datepicker|resizable|sortable)\.js$/ ).test( file );
290+
return !( /(mouse|datepicker|sortable)\.js$/ ).test( file );
291291
}),
292292
grunt: [ "grunt.js", "build/**/*.js" ],
293293
tests: "tests/unit/**/*.js"

tests/unit/all-active.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"menu/menu.html",
2929
"position/position.html",
3030
"progressbar/progressbar.html",
31-
//"resizable/resizable.html",
31+
"resizable/resizable.html",
3232
"selectable/selectable.html",
3333
//"slider/slider.html",
3434
//"sortable/sortable.html",

tests/unit/all.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"menu/menu.html",
2929
"position/position.html",
3030
"progressbar/progressbar.html",
31-
//"resizable/resizable.html",
31+
"resizable/resizable.html",
3232
"selectable/selectable.html",
3333
"slider/slider.html",
3434
//"sortable/sortable.html",

tests/unit/resizable/resizable_core.js

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
22
* resizable_core.js
33
*/
44

5-
TestHelpers.resizableDrag = function(el, dx, dy, complete) {
5+
TestHelpers.resizable = {
6+
drag: function(el, dx, dy, complete) {
67

7-
// speed = sync -> Drag syncrhonously.
8-
// speed = fast|slow -> Drag asyncrhonously - animated.
8+
// speed = sync -> Drag syncrhonously.
9+
// speed = fast|slow -> Drag asyncrhonously - animated.
910

10-
//this mouseover is to work around a limitation in resizable
11-
//TODO: fix resizable so handle doesn't require mouseover in order to be used
12-
$(el).simulate("mouseover");
11+
//this mouseover is to work around a limitation in resizable
12+
//TODO: fix resizable so handle doesn't require mouseover in order to be used
13+
$(el).simulate("mouseover");
1314

14-
return $(el).simulate("drag", {
15-
dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
16-
});
15+
return $(el).simulate("drag", {
16+
dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
17+
});
18+
}
1719
};
1820

1921
(function($) {
@@ -44,10 +46,10 @@ test("n", function() {
4446

4547
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' });
4648

47-
TestHelpers.resizableDrag(handle, 0, -50);
49+
TestHelpers.resizable.drag(handle, 0, -50);
4850
equal( target.height(), 150, "compare height" );
4951

50-
TestHelpers.resizableDrag(handle, 0, 50);
52+
TestHelpers.resizable.drag(handle, 0, 50);
5153
equal( target.height(), 100, "compare height" );
5254
});
5355

@@ -56,10 +58,10 @@ test("s", function() {
5658

5759
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' });
5860

59-
TestHelpers.resizableDrag(handle, 0, 50);
61+
TestHelpers.resizable.drag(handle, 0, 50);
6062
equal( target.height(), 150, "compare height" );
6163

62-
TestHelpers.resizableDrag(handle, 0, -50);
64+
TestHelpers.resizable.drag(handle, 0, -50);
6365
equal( target.height(), 100, "compare height" );
6466
});
6567

@@ -68,10 +70,10 @@ test("e", function() {
6870

6971
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' });
7072

71-
TestHelpers.resizableDrag(handle, 50);
73+
TestHelpers.resizable.drag(handle, 50);
7274
equal( target.width(), 150, "compare width");
7375

74-
TestHelpers.resizableDrag(handle, -50);
76+
TestHelpers.resizable.drag(handle, -50);
7577
equal( target.width(), 100, "compare width" );
7678
});
7779

@@ -80,10 +82,10 @@ test("w", function() {
8082

8183
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' });
8284

83-
TestHelpers.resizableDrag(handle, -50);
85+
TestHelpers.resizable.drag(handle, -50);
8486
equal( target.width(), 150, "compare width" );
8587

86-
TestHelpers.resizableDrag(handle, 50);
88+
TestHelpers.resizable.drag(handle, 50);
8789
equal( target.width(), 100, "compare width" );
8890
});
8991

@@ -92,11 +94,11 @@ test("ne", function() {
9294

9395
var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' });
9496

95-
TestHelpers.resizableDrag(handle, -50, -50);
97+
TestHelpers.resizable.drag(handle, -50, -50);
9698
equal( target.width(), 50, "compare width" );
9799
equal( target.height(), 150, "compare height" );
98100

99-
TestHelpers.resizableDrag(handle, 50, 50);
101+
TestHelpers.resizable.drag(handle, 50, 50);
100102
equal( target.width(), 100, "compare width" );
101103
equal( target.height(), 100, "compare height" );
102104
});
@@ -106,11 +108,11 @@ test("se", function() {
106108

107109
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' });
108110

109-
TestHelpers.resizableDrag(handle, 50, 50);
111+
TestHelpers.resizable.drag(handle, 50, 50);
110112
equal( target.width(), 150, "compare width" );
111113
equal( target.height(), 150, "compare height" );
112114

113-
TestHelpers.resizableDrag(handle, -50, -50);
115+
TestHelpers.resizable.drag(handle, -50, -50);
114116
equal( target.width(), 100, "compare width" );
115117
equal( target.height(), 100, "compare height" );
116118
});
@@ -120,11 +122,11 @@ test("sw", function() {
120122

121123
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' });
122124

123-
TestHelpers.resizableDrag(handle, -50, -50);
125+
TestHelpers.resizable.drag(handle, -50, -50);
124126
equal( target.width(), 150, "compare width" );
125127
equal( target.height(), 50, "compare height" );
126128

127-
TestHelpers.resizableDrag(handle, 50, 50);
129+
TestHelpers.resizable.drag(handle, 50, 50);
128130
equal( target.width(), 100, "compare width" );
129131
equal( target.height(), 100, "compare height" );
130132
});
@@ -134,11 +136,11 @@ test("nw", function() {
134136

135137
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' });
136138

137-
TestHelpers.resizableDrag(handle, -50, -50);
139+
TestHelpers.resizable.drag(handle, -50, -50);
138140
equal( target.width(), 150, "compare width" );
139141
equal( target.height(), 150, "compare height" );
140142

141-
TestHelpers.resizableDrag(handle, 50, 50);
143+
TestHelpers.resizable.drag(handle, 50, 50);
142144
equal( target.width(), 100, "compare width" );
143145
equal( target.height(), 100, "compare height" );
144146
});

tests/unit/resizable/resizable_options.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ test("aspectRatio: 'preserve' (e)", function() {
1010

1111
var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
1212

13-
TestHelpers.resizableDrag(handle, 80);
13+
TestHelpers.resizable.drag(handle, 80);
1414
equal( target.width(), 130, "compare maxWidth");
1515
equal( target.height(), 130, "compare maxHeight");
1616

17-
TestHelpers.resizableDrag(handle, -130);
17+
TestHelpers.resizable.drag(handle, -130);
1818
equal( target.width(), 70, "compare minWidth");
1919
equal( target.height(), 70, "compare minHeight");
2020
});
@@ -24,11 +24,11 @@ test("aspectRatio: 'preserve' (w)", function() {
2424

2525
var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
2626

27-
TestHelpers.resizableDrag(handle, -80);
27+
TestHelpers.resizable.drag(handle, -80);
2828
equal( target.width(), 130, "compare maxWidth");
2929
equal( target.height(), 130, "compare maxHeight");
3030

31-
TestHelpers.resizableDrag(handle, 130);
31+
TestHelpers.resizable.drag(handle, 130);
3232
equal( target.width(), 70, "compare minWidth");
3333
equal( target.height(), 70, "compare minHeight");
3434
});
@@ -38,11 +38,11 @@ test("aspectRatio: 'preserve' (n)", function() {
3838

3939
var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
4040

41-
TestHelpers.resizableDrag(handle, 0, -80);
41+
TestHelpers.resizable.drag(handle, 0, -80);
4242
equal( target.width(), 130, "compare maxWidth");
4343
equal( target.height(), 130, "compare maxHeight");
4444

45-
TestHelpers.resizableDrag(handle, 0, 80);
45+
TestHelpers.resizable.drag(handle, 0, 80);
4646
equal( target.width(), 70, "compare minWidth");
4747
equal( target.height(), 70, "compare minHeight");
4848
});
@@ -52,11 +52,11 @@ test("aspectRatio: 'preserve' (s)", function() {
5252

5353
var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
5454

55-
TestHelpers.resizableDrag(handle, 0, 80);
55+
TestHelpers.resizable.drag(handle, 0, 80);
5656
equal( target.width(), 130, "compare maxWidth");
5757
equal( target.height(), 130, "compare maxHeight");
5858

59-
TestHelpers.resizableDrag(handle, 0, -80);
59+
TestHelpers.resizable.drag(handle, 0, -80);
6060
equal( target.width(), 70, "compare minWidth");
6161
equal( target.height(), 70, "compare minHeight");
6262
});
@@ -66,11 +66,11 @@ test("aspectRatio: 'preserve' (se)", function() {
6666

6767
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
6868

69-
TestHelpers.resizableDrag(handle, 80, 80);
69+
TestHelpers.resizable.drag(handle, 80, 80);
7070
equal( target.width(), 130, "compare maxWidth");
7171
equal( target.height(), 130, "compare maxHeight");
7272

73-
TestHelpers.resizableDrag(handle, -80, -80);
73+
TestHelpers.resizable.drag(handle, -80, -80);
7474
equal( target.width(), 70, "compare minWidth");
7575
equal( target.height(), 70, "compare minHeight");
7676
});
@@ -80,11 +80,11 @@ test("aspectRatio: 'preserve' (sw)", function() {
8080

8181
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
8282

83-
TestHelpers.resizableDrag(handle, -80, 80);
83+
TestHelpers.resizable.drag(handle, -80, 80);
8484
equal( target.width(), 130, "compare maxWidth");
8585
equal( target.height(), 130, "compare maxHeight");
8686

87-
TestHelpers.resizableDrag(handle, 80, -80);
87+
TestHelpers.resizable.drag(handle, 80, -80);
8888
equal( target.width(), 70, "compare minWidth");
8989
equal( target.height(), 70, "compare minHeight");
9090
});
@@ -94,11 +94,11 @@ test("aspectRatio: 'preserve' (ne)", function() {
9494

9595
var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });
9696

97-
TestHelpers.resizableDrag(handle, 80, -80);
97+
TestHelpers.resizable.drag(handle, 80, -80);
9898
equal( target.width(), 130, "compare maxWidth");
9999
equal( target.height(), 130, "compare maxHeight");
100100

101-
TestHelpers.resizableDrag(handle, -80, 80);
101+
TestHelpers.resizable.drag(handle, -80, 80);
102102
equal( target.width(), 70, "compare minWidth");
103103
equal( target.height(), 70, "compare minHeight");
104104
});
@@ -108,11 +108,11 @@ test("grid", function() {
108108

109109
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] });
110110

111-
TestHelpers.resizableDrag(handle, 3, 9);
111+
TestHelpers.resizable.drag(handle, 3, 9);
112112
equal( target.width(), 103, "compare width");
113113
equal( target.height(), 100, "compare height");
114114

115-
TestHelpers.resizableDrag(handle, 15, 11);
115+
TestHelpers.resizable.drag(handle, 15, 11);
116116
equal( target.width(), 118, "compare width");
117117
equal( target.height(), 120, "compare height");
118118
});
@@ -122,11 +122,11 @@ test("grid (wrapped)", function() {
122122

123123
var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] });
124124

125-
TestHelpers.resizableDrag(handle, 3, 9);
125+
TestHelpers.resizable.drag(handle, 3, 9);
126126
equal( target.width(), 103, "compare width");
127127
equal( target.height(), 100, "compare height");
128128

129-
TestHelpers.resizableDrag(handle, 15, 11);
129+
TestHelpers.resizable.drag(handle, 15, 11);
130130
equal( target.width(), 118, "compare width");
131131
equal( target.height(), 120, "compare height");
132132
});
@@ -136,11 +136,11 @@ test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
136136

137137
var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
138138

139-
TestHelpers.resizableDrag(handle, -50, -50);
139+
TestHelpers.resizable.drag(handle, -50, -50);
140140
equal( target.width(), 60, "compare minWidth" );
141141
equal( target.height(), 60, "compare minHeight" );
142142

143-
TestHelpers.resizableDrag(handle, 70, 70);
143+
TestHelpers.resizable.drag(handle, 70, 70);
144144
equal( target.width(), 100, "compare maxWidth" );
145145
equal( target.height(), 100, "compare maxHeight" );
146146
});
@@ -150,11 +150,11 @@ test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
150150

151151
var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
152152

153-
TestHelpers.resizableDrag(handle, 50, -50);
153+
TestHelpers.resizable.drag(handle, 50, -50);
154154
equal( target.width(), 60, "compare minWidth" );
155155
equal( target.height(), 60, "compare minHeight" );
156156

157-
TestHelpers.resizableDrag(handle, -70, 70);
157+
TestHelpers.resizable.drag(handle, -70, 70);
158158
equal( target.width(), 100, "compare maxWidth" );
159159
equal( target.height(), 100, "compare maxHeight" );
160160
});
@@ -164,11 +164,11 @@ test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
164164

165165
var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
166166

167-
TestHelpers.resizableDrag(handle, -50, 50);
167+
TestHelpers.resizable.drag(handle, -50, 50);
168168
equal( target.width(), 60, "compare minWidth" );
169169
equal( target.height(), 60, "compare minHeight" );
170170

171-
TestHelpers.resizableDrag(handle, 70, -70);
171+
TestHelpers.resizable.drag(handle, 70, -70);
172172
equal( target.width(), 100, "compare maxWidth" );
173173
equal( target.height(), 100, "compare maxHeight" );
174174
});
@@ -178,11 +178,11 @@ test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1
178178

179179
var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });
180180

181-
TestHelpers.resizableDrag(handle, 70, 70);
181+
TestHelpers.resizable.drag(handle, 70, 70);
182182
equal( target.width(), 60, "compare minWidth" );
183183
equal( target.height(), 60, "compare minHeight" );
184184

185-
TestHelpers.resizableDrag(handle, -70, -70);
185+
TestHelpers.resizable.drag(handle, -70, -70);
186186
equal( target.width(), 100, "compare maxWidth" );
187187
equal( target.height(), 100, "compare maxHeight" );
188188
});

ui/jquery.ui.droppable.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
* jquery.ui.mouse.js
1515
* jquery.ui.draggable.js
1616
*/
17-
18-
1917
(function( $, undefined ) {
2018

2119
/*jshint onevar: false, curly: false, eqeqeq: false, laxbreak: true */

0 commit comments

Comments
 (0)