Skip to content

Commit 2a8494f

Browse files
committed
Dialog Tests: Cleanup el -> element
1 parent e886e4a commit 2a8494f

File tree

6 files changed

+386
-386
lines changed

6 files changed

+386
-386
lines changed

tests/unit/dialog/dialog_core.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ test("title id", function() {
1010
expect(1);
1111

1212
var titleId,
13-
el = $("<div></div>").dialog();
13+
element = $("<div></div>").dialog();
1414

15-
titleId = el.dialog("widget").find(".ui-dialog-title").attr("id");
15+
titleId = element.dialog("widget").find(".ui-dialog-title").attr("id");
1616
ok( /ui-id-\d+$/.test( titleId ), "auto-numbered title id");
17-
el.remove();
17+
element.remove();
1818
});
1919

2020
test( "ARIA", function() {
2121
expect( 4 );
2222

23-
var el = $( "<div></div>" ).dialog(),
24-
wrapper = el.dialog( "widget" );
23+
var element = $( "<div></div>" ).dialog(),
24+
wrapper = element.dialog( "widget" );
2525
equal( wrapper.attr( "role" ), "dialog", "dialog role" );
2626
equal( wrapper.attr( "aria-labelledby" ), wrapper.find( ".ui-dialog-title" ).attr( "id" ) );
27-
equal( wrapper.attr( "aria-describedby" ), el.attr( "id" ), "aria-describedby added" );
28-
el.remove();
27+
equal( wrapper.attr( "aria-describedby" ), element.attr( "id" ), "aria-describedby added" );
28+
element.remove();
2929

30-
el = $("<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>").dialog();
31-
strictEqual( el.dialog( "widget" ).attr( "aria-describedby" ), undefined, "no aria-describedby added, as already present in markup" );
32-
el.remove();
30+
element = $("<div><div aria-describedby='section2'><p id='section2'>descriotion</p></div></div>").dialog();
31+
strictEqual( element.dialog( "widget" ).attr( "aria-describedby" ), undefined, "no aria-describedby added, as already present in markup" );
32+
element.remove();
3333
});
3434

3535
test("widget method", function() {
@@ -41,7 +41,7 @@ test("widget method", function() {
4141

4242
asyncTest( "focus tabbable", function() {
4343
expect( 5 );
44-
var el,
44+
var element,
4545
options = {
4646
buttons: [{
4747
text: "Ok",
@@ -50,53 +50,53 @@ asyncTest( "focus tabbable", function() {
5050
};
5151

5252
function checkFocus( markup, options, testFn, next ) {
53-
el = $( markup ).dialog( options );
53+
element = $( markup ).dialog( options );
5454
setTimeout(function() {
5555
testFn();
56-
el.remove();
56+
element.remove();
5757
setTimeout( next );
5858
});
5959
}
6060

6161
function step1() {
6262
checkFocus( "<div><input><input autofocus></div>", options, function() {
63-
equal( document.activeElement, el.find( "input" )[ 1 ],
63+
equal( document.activeElement, element.find( "input" )[ 1 ],
6464
"1. first element inside the dialog matching [autofocus]" );
6565
}, step2 );
6666
}
6767

6868
function step2() {
6969
checkFocus( "<div><input><input></div>", options, function() {
70-
equal( document.activeElement, el.find( "input" )[ 0 ],
70+
equal( document.activeElement, element.find( "input" )[ 0 ],
7171
"2. tabbable element inside the content element" );
7272
}, step3 );
7373
}
7474

7575
function step3() {
7676
checkFocus( "<div>text</div>", options, function() {
7777
equal( document.activeElement,
78-
el.dialog( "widget" ).find( ".ui-dialog-buttonpane button" )[ 0 ],
78+
element.dialog( "widget" ).find( ".ui-dialog-buttonpane button" )[ 0 ],
7979
"3. tabbable element inside the buttonpane" );
8080
}, step4 );
8181
}
8282

8383
function step4() {
8484
checkFocus( "<div>text</div>", {}, function() {
8585
equal( document.activeElement,
86-
el.dialog( "widget" ).find( ".ui-dialog-titlebar .ui-dialog-titlebar-close" )[ 0 ],
86+
element.dialog( "widget" ).find( ".ui-dialog-titlebar .ui-dialog-titlebar-close" )[ 0 ],
8787
"4. the close button" );
8888
}, step5 );
8989
}
9090

9191
function step5() {
92-
el = $( "<div>text</div>" ).dialog({
92+
element = $( "<div>text</div>" ).dialog({
9393
autoOpen: false
9494
});
95-
el.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).hide();
96-
el.dialog( "open" );
95+
element.dialog( "widget" ).find( ".ui-dialog-titlebar-close" ).hide();
96+
element.dialog( "open" );
9797
setTimeout(function() {
98-
equal( document.activeElement, el.parent()[ 0 ], "5. the dialog itself" );
99-
el.remove();
98+
equal( document.activeElement, element.parent()[ 0 ], "5. the dialog itself" );
99+
element.remove();
100100
start();
101101
});
102102
}
@@ -119,9 +119,9 @@ test( "#7960: resizable handles below modal overlays", function() {
119119
asyncTest( "Prevent tabbing out of dialogs", function() {
120120
expect( 3 );
121121

122-
var el = $( "<div><input><input></div>" ).dialog(),
123-
inputs = el.find( "input" ),
124-
widget = el.dialog( "widget" )[ 0 ];
122+
var element = $( "<div><input><input></div>" ).dialog(),
123+
inputs = element.find( "input" ),
124+
widget = element.dialog( "widget" )[ 0 ];
125125

126126
function checkTab() {
127127
ok( $.contains( widget, document.activeElement ), "Tab key event moved focus within the modal" );
@@ -134,7 +134,7 @@ asyncTest( "Prevent tabbing out of dialogs", function() {
134134
function checkShiftTab() {
135135
ok( $.contains( widget, document.activeElement ), "Shift-Tab key event moved focus within the modal" );
136136

137-
el.remove();
137+
element.remove();
138138
setTimeout( start );
139139
}
140140

tests/unit/dialog/dialog_deprecated.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ test( "position, right bottom on window w/array", function() {
88
// Support: FF, IE7
99
var winWidth = $( window ).width(),
1010
winHeight = $( window ).height(),
11-
el = $("<div></div>").dialog({ position: [ "right", "bottom" ] }),
12-
dialog = el.dialog("widget"),
11+
element = $("<div></div>").dialog({ position: [ "right", "bottom" ] }),
12+
dialog = element.dialog("widget"),
1313
offset = dialog.offset();
1414
closeEnough( offset.left, winWidth - dialog.outerWidth() + $( window ).scrollLeft(), 1, "offset left of right bottom on window w/array" );
1515
closeEnough( offset.top, winHeight - dialog.outerHeight() + $( window ).scrollTop(), 1, "offset top of right bottom on window w/array" );
16-
el.remove();
16+
element.remove();
1717
});
1818

1919
test( "position, right bottom on window", function() {
@@ -24,40 +24,40 @@ test( "position, right bottom on window", function() {
2424
// Support: FF, IE7
2525
var winWidth = $( window ).width(),
2626
winHeight = $( window ).height(),
27-
el = $("<div></div>").dialog({ position: "right bottom" }),
28-
dialog = el.dialog("widget"),
27+
element = $("<div></div>").dialog({ position: "right bottom" }),
28+
dialog = element.dialog("widget"),
2929
offset = dialog.offset();
3030
closeEnough( offset.left, winWidth - dialog.outerWidth() + $( window ).scrollLeft(), 1, "offset left of right bottom on window" );
3131
closeEnough( offset.top, winHeight - dialog.outerHeight() + $( window ).scrollTop(), 1, "offset top of right bottom on window" );
32-
el.remove();
32+
element.remove();
3333
});
3434

3535
test("position, offset from top left w/array", function() {
3636
expect( 2 );
37-
var el = $("<div></div>").dialog({ position: [10, 10] }),
38-
dialog = el.dialog("widget"),
37+
var element = $("<div></div>").dialog({ position: [10, 10] }),
38+
dialog = element.dialog("widget"),
3939
offset = dialog.offset();
4040
closeEnough(offset.left, 10 + $(window).scrollLeft(), 1);
4141
closeEnough(offset.top, 10 + $(window).scrollTop(), 1);
42-
el.remove();
42+
element.remove();
4343
});
4444

4545
test("position, top on window", function() {
4646
expect( 2 );
47-
var el = $("<div></div>").dialog({ position: "top" }),
48-
dialog = el.dialog("widget"),
47+
var element = $("<div></div>").dialog({ position: "top" }),
48+
dialog = element.dialog("widget"),
4949
offset = dialog.offset();
5050
closeEnough(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft(), 1);
5151
closeEnough(offset.top, $(window).scrollTop(), 1);
52-
el.remove();
52+
element.remove();
5353
});
5454

5555
test("position, left on window", function() {
5656
expect( 2 );
57-
var el = $("<div></div>").dialog({ position: "left" }),
58-
dialog = el.dialog("widget"),
57+
var element = $("<div></div>").dialog({ position: "left" }),
58+
dialog = element.dialog("widget"),
5959
offset = dialog.offset();
6060
closeEnough(offset.left, 0, 1);
6161
closeEnough(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop(), 1);
62-
el.remove();
62+
element.remove();
6363
});

0 commit comments

Comments
 (0)