diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2021-06-07 00:58:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 00:58:12 +0200 |
commit | 70dae67b73dfea9126f126f516fe8286f1e73417 (patch) | |
tree | e61eafab41ee74330fecf1da2ce125050cfac49b /tests/unit | |
parent | a12c98574d07f002fd59d166f9fc1fd391581b91 (diff) | |
download | jquery-ui-70dae67b73dfea9126f126f516fe8286f1e73417.tar.gz jquery-ui-70dae67b73dfea9126f126f516fe8286f1e73417.zip |
Build: Migrate from JSHint & JSCS to ESLint
Fixes #15393
Closes gh-1958
Diffstat (limited to 'tests/unit')
96 files changed, 217 insertions, 75 deletions
diff --git a/tests/unit/accordion/core.js b/tests/unit/accordion/core.js index ad7177b8f..7436ba7a9 100644 --- a/tests/unit/accordion/core.js +++ b/tests/unit/accordion/core.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/accordion" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach, state = testHelper.state; diff --git a/tests/unit/accordion/events.js b/tests/unit/accordion/events.js index 5b8525132..2c5e791a1 100644 --- a/tests/unit/accordion/events.js +++ b/tests/unit/accordion/events.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/accordion" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach, state = testHelper.state; diff --git a/tests/unit/accordion/helper.js b/tests/unit/accordion/helper.js index 3211765af..b50c389e2 100644 --- a/tests/unit/accordion/helper.js +++ b/tests/unit/accordion/helper.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/accordion" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { equalHeight: function( assert, accordion, height ) { diff --git a/tests/unit/accordion/methods.js b/tests/unit/accordion/methods.js index 622235785..e4ab62ffb 100644 --- a/tests/unit/accordion/methods.js +++ b/tests/unit/accordion/methods.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/accordion" ], function( QUnit, $, testHelper ) { +"use strict"; var equalHeight = testHelper.equalHeight, beforeAfterEach = testHelper.beforeAfterEach, diff --git a/tests/unit/accordion/options.js b/tests/unit/accordion/options.js index ae53e5c45..00c1d0361 100644 --- a/tests/unit/accordion/options.js +++ b/tests/unit/accordion/options.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/accordion" ], function( QUnit, $, testHelper ) { +"use strict"; var equalHeight = testHelper.equalHeight, beforeAfterEach = testHelper.beforeAfterEach, diff --git a/tests/unit/autocomplete/core.js b/tests/unit/autocomplete/core.js index 8768ec2af..d78db3bb9 100644 --- a/tests/unit/autocomplete/core.js +++ b/tests/unit/autocomplete/core.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/autocomplete" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "autocomplete: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/autocomplete/events.js b/tests/unit/autocomplete/events.js index 801c2d935..d08fe9828 100644 --- a/tests/unit/autocomplete/events.js +++ b/tests/unit/autocomplete/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/autocomplete" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "autocomplete: events", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/autocomplete/methods.js b/tests/unit/autocomplete/methods.js index 597c9c2ad..cb0f95332 100644 --- a/tests/unit/autocomplete/methods.js +++ b/tests/unit/autocomplete/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/autocomplete" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "autocomplete: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/autocomplete/options.js b/tests/unit/autocomplete/options.js index c4de8d5d3..b66a71577 100644 --- a/tests/unit/autocomplete/options.js +++ b/tests/unit/autocomplete/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/autocomplete" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "autocomplete: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/button/core.js b/tests/unit/button/core.js index d5d19f953..7b696631e 100644 --- a/tests/unit/button/core.js +++ b/tests/unit/button/core.js @@ -5,6 +5,7 @@ define( [ "ui/safe-active-element", "ui/widgets/button" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Button: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/button/deprecated.js b/tests/unit/button/deprecated.js index 6866f7371..e1e617608 100644 --- a/tests/unit/button/deprecated.js +++ b/tests/unit/button/deprecated.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/button" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Button (deprecated): core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/button/events.js b/tests/unit/button/events.js index 577407361..a5d02a127 100644 --- a/tests/unit/button/events.js +++ b/tests/unit/button/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/button" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Button: events", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/button/methods.js b/tests/unit/button/methods.js index 80ce27b39..71909f87f 100644 --- a/tests/unit/button/methods.js +++ b/tests/unit/button/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/button" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Button: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/button/options.js b/tests/unit/button/options.js index 8a9acd60b..601b66f3d 100644 --- a/tests/unit/button/options.js +++ b/tests/unit/button/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/button" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "button: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/checkboxradio/core.js b/tests/unit/checkboxradio/core.js index b16c09408..8b0e1de8e 100644 --- a/tests/unit/checkboxradio/core.js +++ b/tests/unit/checkboxradio/core.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/checkboxradio" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Checkboxradio: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/checkboxradio/events.js b/tests/unit/checkboxradio/events.js index 0760a4387..0604fffac 100644 --- a/tests/unit/checkboxradio/events.js +++ b/tests/unit/checkboxradio/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/checkboxradio" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Checkboxradio: events", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/checkboxradio/methods.js b/tests/unit/checkboxradio/methods.js index bfb30dbce..09510ec71 100644 --- a/tests/unit/checkboxradio/methods.js +++ b/tests/unit/checkboxradio/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/checkboxradio" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Checkboxradio: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/checkboxradio/options.js b/tests/unit/checkboxradio/options.js index 256381da6..e2869ddbd 100644 --- a/tests/unit/checkboxradio/options.js +++ b/tests/unit/checkboxradio/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/checkboxradio" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Checkboxradio: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/controlgroup/core.js b/tests/unit/controlgroup/core.js index baccb3b16..d5cc5c732 100644 --- a/tests/unit/controlgroup/core.js +++ b/tests/unit/controlgroup/core.js @@ -8,6 +8,7 @@ define( [ "ui/widgets/button", "ui/widgets/spinner" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Controlgroup: Core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/controlgroup/methods.js b/tests/unit/controlgroup/methods.js index 8f1f58947..8ac310c25 100644 --- a/tests/unit/controlgroup/methods.js +++ b/tests/unit/controlgroup/methods.js @@ -8,6 +8,7 @@ define( [ "ui/widgets/button", "ui/widgets/spinner" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Controlgroup: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/controlgroup/options.js b/tests/unit/controlgroup/options.js index 4fc870675..31be89b27 100644 --- a/tests/unit/controlgroup/options.js +++ b/tests/unit/controlgroup/options.js @@ -8,6 +8,7 @@ define( [ "ui/widgets/button", "ui/widgets/spinner" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "Controlgroup: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/core/core.js b/tests/unit/core/core.js index 94c126123..d9677a406 100644 --- a/tests/unit/core/core.js +++ b/tests/unit/core/core.js @@ -7,11 +7,10 @@ define( [ "ui/labels", "ui/unique-id" ], function( QUnit, $, common, helper ) { +"use strict"; QUnit.module( "core - jQuery extensions", { afterEach: helper.moduleAfterEach } ); -common.testJshint( "core" ); - QUnit.test( "innerWidth - getter", function( assert ) { assert.expect( 2 ); var el = $( "#dimensions" ); diff --git a/tests/unit/core/selector.js b/tests/unit/core/selector.js index 61f4a2381..314cfd570 100644 --- a/tests/unit/core/selector.js +++ b/tests/unit/core/selector.js @@ -6,6 +6,7 @@ define( [ "ui/focusable", "ui/tabbable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "core - selectors", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/datepicker/core.js b/tests/unit/datepicker/core.js index 2c4b77402..74320931e 100644 --- a/tests/unit/datepicker/core.js +++ b/tests/unit/datepicker/core.js @@ -7,6 +7,7 @@ define( [ "ui/widgets/datepicker", "ui/i18n/datepicker-he" ], function( QUnit, $, common, helper, testHelper ) { +"use strict"; QUnit.module( "datepicker: core", { beforeEach: function() { @@ -15,8 +16,6 @@ QUnit.module( "datepicker: core", { afterEach: helper.moduleAfterEach } ); -common.testJshint( "widgets/datepicker" ); - QUnit.test( "initialization - Reinitialization after body had been emptied.", function( assert ) { assert.expect( 1 ); var bodyContent = $( "body" ).children(), inp = $( "#inp" ); @@ -57,7 +56,7 @@ QUnit.test( "baseStructure", function( assert ) { assert.ok( header.is( "div.ui-datepicker-header" ), "Structure - header division" ); assert.equal( header.children().length, 3, "Structure - header child count" ); assert.ok( header.children().first().is( "a.ui-datepicker-prev" ) && header.children().first().html() !== "", "Structure - prev link" ); - assert.ok( header.children().eq( 1 ).is( "a.ui-datepicker-next" ) && header.children().eq ( 1 ).html() !== "", "Structure - next link" ); + assert.ok( header.children().eq( 1 ).is( "a.ui-datepicker-next" ) && header.children().eq( 1 ).html() !== "", "Structure - next link" ); title = header.children().last(); assert.ok( title.is( "div.ui-datepicker-title" ) && title.html() !== "", "Structure - title division" ); diff --git a/tests/unit/datepicker/events.js b/tests/unit/datepicker/events.js index 44064ee21..50ee07b86 100644 --- a/tests/unit/datepicker/events.js +++ b/tests/unit/datepicker/events.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/datepicker" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; @@ -136,8 +137,12 @@ QUnit.test( "events", function( assert ) { QUnit.test( "beforeShowDay-getDate", function( assert ) { assert.expect( 3 ); - var inp = testHelper.init( "#inp", { beforeShowDay: function() { inp.datepicker( "getDate" ); return [ true, "" ]; } } ), - dp = $( "#ui-datepicker-div" ); + var inp = testHelper.init( "#inp", { + beforeShowDay: function() { + inp.datepicker( "getDate" ); return [ true, "" ]; + } + } ); + var dp = $( "#ui-datepicker-div" ); inp.val( "01/01/2010" ).datepicker( "show" ); // Contains non-breaking space diff --git a/tests/unit/datepicker/helper.js b/tests/unit/datepicker/helper.js index 85485ddf4..652609d54 100644 --- a/tests/unit/datepicker/helper.js +++ b/tests/unit/datepicker/helper.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/datepicker" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { addMonths: function( date, offset ) { diff --git a/tests/unit/datepicker/methods.js b/tests/unit/datepicker/methods.js index fed04ccdd..32d611748 100644 --- a/tests/unit/datepicker/methods.js +++ b/tests/unit/datepicker/methods.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/datepicker" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; diff --git a/tests/unit/datepicker/options.js b/tests/unit/datepicker/options.js index 51ed93b71..50260d816 100644 --- a/tests/unit/datepicker/options.js +++ b/tests/unit/datepicker/options.js @@ -8,6 +8,7 @@ define( [ "ui/i18n/datepicker-zh-CN", "ui/ie" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; @@ -902,7 +903,7 @@ QUnit.test( "localisation", function( assert ) { assert.expect( 24 ); var dp, month, day, date, inp = testHelper.init( "#inp", $.datepicker.regional.fr ); - inp.datepicker( "option", { dateFormat: "DD, d MM yy", showButtonPanel:true, changeMonth:true, changeYear:true } ).val( "" ).datepicker( "show" ); + inp.datepicker( "option", { dateFormat: "DD, d MM yy", showButtonPanel: true, changeMonth: true, changeYear: true } ).val( "" ).datepicker( "show" ); dp = $( "#ui-datepicker-div" ); assert.equal( $( ".ui-datepicker-close", dp ).text(), "Fermer", "Localisation - close" ); $( ".ui-datepicker-close", dp ).simulate( "mouseover" ); @@ -1039,50 +1040,85 @@ QUnit.test( "parseDateErrors", function( assert ) { try { expr(); assert.ok( false, "Parsed error " + value ); - } - catch ( e ) { + } catch ( e ) { assert.equal( e, error, "Parsed error " + value ); } } - expectError( function() { $.datepicker.parseDate( null, "Sat 2 01" ); }, + expectError( function() { + $.datepicker.parseDate( null, "Sat 2 01" ); + }, "Sat 2 01", "Invalid arguments" ); - expectError( function() { $.datepicker.parseDate( "d m y", null ); }, + expectError( function() { + $.datepicker.parseDate( "d m y", null ); + }, "null", "Invalid arguments" ); - expectError( function() { $.datepicker.parseDate( "d m y", "Sat 2 01" ); }, + expectError( function() { + $.datepicker.parseDate( "d m y", "Sat 2 01" ); + }, "Sat 2 01 - d m y", "Missing number at position 0" ); - expectError( function() { $.datepicker.parseDate( "dd mm yy", "Sat 2 01" ); }, + expectError( function() { + $.datepicker.parseDate( "dd mm yy", "Sat 2 01" ); + }, "Sat 2 01 - dd mm yy", "Missing number at position 0" ); - expectError( function() { $.datepicker.parseDate( "d m y", "3 Feb 01" ); }, + expectError( function() { + $.datepicker.parseDate( "d m y", "3 Feb 01" ); + }, "3 Feb 01 - d m y", "Missing number at position 2" ); - expectError( function() { $.datepicker.parseDate( "dd mm yy", "3 Feb 01" ); }, + expectError( function() { + $.datepicker.parseDate( "dd mm yy", "3 Feb 01" ); + }, "3 Feb 01 - dd mm yy", "Missing number at position 2" ); - expectError( function() { $.datepicker.parseDate( "mm dd yy", "2 1 01" ); }, + expectError( function() { + $.datepicker.parseDate( "mm dd yy", "2 1 01" ); + }, "2 1 01 - dd mm yy", "Missing number at position 4" ); - expectError( function() { $.datepicker.parseDate( "d m y", "3 2 AD01" ); }, + expectError( function() { + $.datepicker.parseDate( "d m y", "3 2 AD01" ); + }, "3 2 AD01 - d m y", "Missing number at position 4" ); - expectError( function() { $.datepicker.parseDate( "d m yy", "3 2 AD01" ); }, + expectError( function() { + $.datepicker.parseDate( "d m yy", "3 2 AD01" ); + }, "3 2 AD01 - dd mm yy", "Missing number at position 4" ); - expectError( function() { $.datepicker.parseDate( "y-o", "01-D01" ); }, + expectError( function() { + $.datepicker.parseDate( "y-o", "01-D01" ); + }, "2001-D01 - y-o", "Missing number at position 3" ); - expectError( function() { $.datepicker.parseDate( "yy-oo", "2001-D01" ); }, + expectError( function() { + $.datepicker.parseDate( "yy-oo", "2001-D01" ); + }, "2001-D01 - yy-oo", "Missing number at position 5" ); - expectError( function() { $.datepicker.parseDate( "D d M y", "D7 3 Feb 01" ); }, + expectError( function() { + $.datepicker.parseDate( "D d M y", "D7 3 Feb 01" ); + }, "D7 3 Feb 01 - D d M y", "Unknown name at position 0" ); - expectError( function() { $.datepicker.parseDate( "D d M y", "Sat 3 M2 01" ); }, + expectError( function() { + $.datepicker.parseDate( "D d M y", "Sat 3 M2 01" ); + }, "Sat 3 M2 01 - D d M y", "Unknown name at position 6" ); - expectError( function() { $.datepicker.parseDate( "DD, MM d, yy", "Saturday- Feb 3, 2001" ); }, + expectError( function() { + $.datepicker.parseDate( "DD, MM d, yy", "Saturday- Feb 3, 2001" ); + }, "Saturday- Feb 3, 2001 - DD, MM d, yy", "Unexpected literal at position 8" ); - expectError( function() { $.datepicker.parseDate( "'day' d 'of' MM (''DD''), yy", - "day 3 of February (\"Saturday\"), 2001" ); }, + expectError( function() { + $.datepicker.parseDate( "'day' d 'of' MM (''DD''), yy", + "day 3 of February (\"Saturday\"), 2001" ); + }, "day 3 of Mon2 ('Day7'), 2001", "Unexpected literal at position 19" ); - expectError( function() { $.datepicker.parseDate( "d m y", "29 2 01" ); }, + expectError( function() { + $.datepicker.parseDate( "d m y", "29 2 01" ); + }, "29 2 01 - d m y", "Invalid date" ); fr = $.datepicker.regional.fr; settings = { dayNamesShort: fr.dayNamesShort, dayNames: fr.dayNames, monthNamesShort: fr.monthNamesShort, monthNames: fr.monthNames }; - expectError( function() { $.datepicker.parseDate( "D d M y", "Mon 9 Avr 01", settings ); }, + expectError( function() { + $.datepicker.parseDate( "D d M y", "Mon 9 Avr 01", settings ); + }, "Mon 9 Avr 01 - D d M y", "Unknown name at position 0" ); - expectError( function() { $.datepicker.parseDate( "D d M y", "Lun. 9 Apr 01", settings ); }, + expectError( function() { + $.datepicker.parseDate( "D d M y", "Lun. 9 Apr 01", settings ); + }, "Lun. 9 Apr 01 - D d M y", "Unknown name at position 7" ); } ); @@ -1092,7 +1128,7 @@ QUnit.test( "Ticket #7244: date parser does not fail when too many numbers are p try { date = $.datepicker.parseDate( "dd/mm/yy", "18/04/19881" ); assert.ok( false, "Did not properly detect an invalid date" ); - }catch ( e ) { + } catch ( e ) { assert.ok( "invalid date detected" ); } diff --git a/tests/unit/dialog/core.js b/tests/unit/dialog/core.js index 171d2789e..cb0ee53e0 100644 --- a/tests/unit/dialog/core.js +++ b/tests/unit/dialog/core.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/dialog" ], function( QUnit, $, helper ) { +"use strict"; // TODO add afterEach callback to remove dialogs QUnit.module( "dialog: core", { afterEach: helper.moduleAfterEach } ); @@ -209,8 +210,7 @@ QUnit.test( "focus tabbable", function( assert ) { function( done ) { var inputs = element.find( "input" ); - assert.equal - ( document.activeElement, inputs[ 1 ], "Focus starts on second input" ); + assert.equal( document.activeElement, inputs[ 1 ], "Focus starts on second input" ); inputs.last().simulate( "keydown", { keyCode: $.ui.keyCode.TAB } ); setTimeout( function() { assert.equal( document.activeElement, inputs[ 0 ], @@ -275,7 +275,7 @@ QUnit.test( "#9048: multiple modal dialogs opened and closed in different order" function( assert ) { var ready = assert.async(); assert.expect( 1 ); - $( "#dialog1, #dialog2" ).dialog( { autoOpen: false, modal:true } ); + $( "#dialog1, #dialog2" ).dialog( { autoOpen: false, modal: true } ); $( "#dialog1" ).dialog( "open" ); $( "#dialog2" ).dialog( "open" ); $( "#dialog1" ).dialog( "close" ); @@ -311,9 +311,7 @@ QUnit.test( "interaction between overlay and other dialogs", function( assert ) // Wait for the modal to init setTimeout( function() { - second. - testWidget - ( "open" ); + second.testWidget( "open" ); // Simulate user tabbing from address bar to an element outside the dialog $( "#favorite-animal" ).trigger( "focus" ); diff --git a/tests/unit/dialog/deprecated.js b/tests/unit/dialog/deprecated.js index ab49fe756..b8cf7a9a5 100644 --- a/tests/unit/dialog/deprecated.js +++ b/tests/unit/dialog/deprecated.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/dialog" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "dialog (deprecated): options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/dialog/events.js b/tests/unit/dialog/events.js index a98d1396d..eb77de2ff 100644 --- a/tests/unit/dialog/events.js +++ b/tests/unit/dialog/events.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/dialog" ], function( QUnit, $, testHelper ) { +"use strict"; QUnit.module( "dialog: events", { afterEach: testHelper.moduleAfterEach } ); diff --git a/tests/unit/dialog/helper.js b/tests/unit/dialog/helper.js index ac013ecfc..55555626a 100644 --- a/tests/unit/dialog/helper.js +++ b/tests/unit/dialog/helper.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/dialog" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { drag: function( element, handle, dx, dy ) { diff --git a/tests/unit/dialog/methods.js b/tests/unit/dialog/methods.js index e289d81a7..5d01f223d 100644 --- a/tests/unit/dialog/methods.js +++ b/tests/unit/dialog/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/dialog" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "dialog: methods", { afterEach: function() { @@ -68,7 +69,7 @@ QUnit.test( "destroy", function( assert ) { assert.equal( $( ".ui-widget-overlay" ).length, 0, "overlay does not exist" ); assert.equal( $( document ).data( "ui-dialog-overlays" ), undefined, "ui-dialog-overlays equals the number of open overlays" ); - element = $( "#dialog1" ).dialog( { modal: true } ), + element = $( "#dialog1" ).dialog( { modal: true } ); element2 = $( "#dialog2" ).dialog( { modal: true } ); assert.equal( $( ".ui-widget-overlay" ).length, 2, "overlays created when dialogs are open" ); assert.equal( $( document ).data( "ui-dialog-overlays" ), 2, "ui-dialog-overlays equals the number of open overlays" ); @@ -86,7 +87,7 @@ QUnit.test( "destroy", function( assert ) { QUnit.test( "#9000: Dialog leaves broken event handler after close/destroy in certain cases", function( assert ) { var ready = assert.async(); assert.expect( 1 ); - $( "#dialog1" ).dialog( { modal:true } ).dialog( "close" ).dialog( "destroy" ); + $( "#dialog1" ).dialog( { modal: true } ).dialog( "close" ).dialog( "destroy" ); setTimeout( function() { $( "#favorite-animal" ).trigger( "focus" ); assert.ok( true, "close and destroy modal dialog before its really opened" ); diff --git a/tests/unit/dialog/options.js b/tests/unit/dialog/options.js index 078d32f8d..2de788a44 100644 --- a/tests/unit/dialog/options.js +++ b/tests/unit/dialog/options.js @@ -7,6 +7,7 @@ define( [ "ui/effects/effect-blind", "ui/effects/effect-explode" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "dialog: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/draggable/core.js b/tests/unit/draggable/core.js index b5dec8104..9cfbb1853 100644 --- a/tests/unit/draggable/core.js +++ b/tests/unit/draggable/core.js @@ -7,6 +7,7 @@ define( [ "ui/widgets/droppable", "ui/widgets/resizable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "draggable: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/draggable/events.js b/tests/unit/draggable/events.js index c25754923..97ec912ae 100644 --- a/tests/unit/draggable/events.js +++ b/tests/unit/draggable/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/draggable" ], function( QUnit, $, helper ) { +"use strict"; var element; diff --git a/tests/unit/draggable/helper.js b/tests/unit/draggable/helper.js index de5dc4a6b..c1920f23b 100644 --- a/tests/unit/draggable/helper.js +++ b/tests/unit/draggable/helper.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/draggable" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { diff --git a/tests/unit/draggable/methods.js b/tests/unit/draggable/methods.js index 19c7424a0..93f826faf 100644 --- a/tests/unit/draggable/methods.js +++ b/tests/unit/draggable/methods.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/draggable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var element; diff --git a/tests/unit/draggable/options.js b/tests/unit/draggable/options.js index b4f5620d6..499454a65 100644 --- a/tests/unit/draggable/options.js +++ b/tests/unit/draggable/options.js @@ -7,6 +7,7 @@ define( [ "ui/widgets/droppable", "ui/widgets/sortable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "draggable: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/droppable/core.js b/tests/unit/droppable/core.js index 80764711e..5cc6771f9 100644 --- a/tests/unit/droppable/core.js +++ b/tests/unit/droppable/core.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/droppable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "droppable: core", { afterEach: helper.moduleAfterEach } ); @@ -20,7 +21,9 @@ QUnit.test( "element types", function( assert ) { var typeName = typeNames[ i ], el = $( document.createElement( typeName ) ).appendTo( "body" ); - ( typeName === "table" && el.append( "<tr><td>content</td></tr>" ) ); + if ( typeName === "table" ) { + el.append( "<tr><td>content</td></tr>" ); + } el.droppable(); testHelper.shouldDrop( assert ); el.droppable( "destroy" ); diff --git a/tests/unit/droppable/events.js b/tests/unit/droppable/events.js index 734aee1db..8b2bbd38e 100644 --- a/tests/unit/droppable/events.js +++ b/tests/unit/droppable/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/droppable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "droppable: events", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/droppable/helper.js b/tests/unit/droppable/helper.js index f6bf9e411..2cf1b5c53 100644 --- a/tests/unit/droppable/helper.js +++ b/tests/unit/droppable/helper.js @@ -3,6 +3,7 @@ define( [ "jquery", "lib/helper" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { shouldDrop: function( assert ) { diff --git a/tests/unit/droppable/methods.js b/tests/unit/droppable/methods.js index 3a078224a..96df6ea40 100644 --- a/tests/unit/droppable/methods.js +++ b/tests/unit/droppable/methods.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/droppable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "droppable: methods", { afterEach: helper.moduleAfterEach } ); @@ -61,7 +62,7 @@ QUnit.test( "enable", function( assert ) { assert.equal( el.droppable( "option", "disabled" ), false, "disabled option setter" ); testHelper.shouldDrop( assert ); - expected = $( "<div></div>" ).droppable(), + expected = $( "<div></div>" ).droppable(); actual = expected.droppable( "enable" ); assert.equal( actual, expected, "enable is chainable" ); } ); diff --git a/tests/unit/droppable/options.js b/tests/unit/droppable/options.js index 560de09fe..7cc765cf5 100644 --- a/tests/unit/droppable/options.js +++ b/tests/unit/droppable/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/droppable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "droppable: options", { afterEach: helper.moduleAfterEach } ); @@ -80,6 +81,7 @@ QUnit.test( "scope", function( assert ) { assert.equal( draggableOffset.left, oldDraggableOffset.left ); assert.equal( draggableOffset.top, oldDraggableOffset.top ); } ); + /* Test( "greedy", function() { ok(false, 'missing test - untested code is broken code'); diff --git a/tests/unit/effects/core.js b/tests/unit/effects/core.js index b2d039a54..187f5355a 100644 --- a/tests/unit/effects/core.js +++ b/tests/unit/effects/core.js @@ -20,6 +20,7 @@ define( [ "ui/effects/effect-slide", "ui/effects/effect-transfer" ], function( QUnit, $, common, helper ) { +"use strict"; QUnit.assert.present = function( value, array, message ) { this.push( jQuery.inArray( value, array ) !== -1, value, array, message ); @@ -268,7 +269,7 @@ QUnit.test( "createPlaceholder: preserves layout affecting properties", function assert.deepEqual( before.position.top - position, placeholder.position().top, "position top preserved" ); assert.deepEqual( before.position.left - position, placeholder.position().left, "position left preserved" ); - assert.deepEqual( before[ "float" ], placeholder.css( "float" ), "float preserved" ); + assert.deepEqual( before.float, placeholder.css( "float" ), "float preserved" ); assert.deepEqual( before.outerWidth, placeholder.outerWidth( true ), "width preserved" ); assert.deepEqual( before.outerHeight, placeholder.outerHeight( true ), "height preserved" ); } ); @@ -304,8 +305,6 @@ QUnit.test( "transfer() with callback", function( assert ) { $.each( $.effects.effect, function( effect ) { QUnit.module( "effects." + effect ); - common.testJshint( "effects/effect-" + effect ); - if ( effect === "transfer" ) { return; } diff --git a/tests/unit/effects/scale.js b/tests/unit/effects/scale.js index c6b0c9aa3..e5300028d 100644 --- a/tests/unit/effects/scale.js +++ b/tests/unit/effects/scale.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/effects/effect-scale" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "effect.scale: Scale", { afterEach: helper.moduleAfterEach } ); @@ -34,8 +35,20 @@ function run( position, v, h, vo, ho ) { css[ h ] = 33; css[ v ] = 33; - target[ h ] = h === ho ? css[ h ] : ho === "center" ? css[ h ] - 35 : css[ h ] - 70; - target[ v ] = v === vo ? css[ v ] : vo === "middle" ? css[ v ] - 35 : css[ v ] - 70; + if ( h === ho ) { + target[ h ] = css[ h ]; + } else if ( ho === "center" ) { + target[ h ] = css[ h ] - 35; + } else { + target[ h ] = css[ h ] - 70; + } + if ( v === vo ) { + target[ v ] = css[ v ]; + } else if ( vo === "middle" ) { + target[ v ] = css[ v ] - 35; + } else { + target[ v ] = css[ v ] - 70; + } if ( relative && h === "right" ) { target[ h ] += 70; } @@ -51,6 +64,7 @@ function suite( position ) { run( position, "top", "left", "top", "left" ); run( position, "top", "left", "middle", "center" ); run( position, "top", "left", "bottom", "right" ); + /* Firefox is currently not capable of supporting detection of bottom and right.... run( position, "bottom", "right", "top", "left" ); run( position, "bottom", "right", "middle", "center" ); diff --git a/tests/unit/form-reset-mixin/core.js b/tests/unit/form-reset-mixin/core.js index daca4dcf1..aca84ef0c 100644 --- a/tests/unit/form-reset-mixin/core.js +++ b/tests/unit/form-reset-mixin/core.js @@ -6,6 +6,7 @@ define( [ "ui/widget", "ui/form-reset-mixin" ], function( QUnit, $, common, helper ) { +"use strict"; QUnit.module( "widget factory", { beforeEach: function() { @@ -31,8 +32,6 @@ QUnit.module( "widget factory", { } } ); -common.testJshint( "form-reset-mixin" ); - QUnit.test( "form reset", function( assert ) { var ready = assert.async(); assert.expect( 2 ); diff --git a/tests/unit/menu/core.js b/tests/unit/menu/core.js index 9e7bd1910..84add3cfb 100644 --- a/tests/unit/menu/core.js +++ b/tests/unit/menu/core.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/menu" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "menu: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/menu/events.js b/tests/unit/menu/events.js index c50c184ec..caac7e741 100644 --- a/tests/unit/menu/events.js +++ b/tests/unit/menu/events.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/menu" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var log = testHelper.log, logOutput = testHelper.logOutput, diff --git a/tests/unit/menu/methods.js b/tests/unit/menu/methods.js index a5e5a90e3..3c304c264 100644 --- a/tests/unit/menu/methods.js +++ b/tests/unit/menu/methods.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/menu" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var log = testHelper.log, logOutput = testHelper.logOutput, diff --git a/tests/unit/menu/options.js b/tests/unit/menu/options.js index 525c6f016..edbfec447 100644 --- a/tests/unit/menu/options.js +++ b/tests/unit/menu/options.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/menu" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var log = testHelper.log, logOutput = testHelper.logOutput, diff --git a/tests/unit/position/core.js b/tests/unit/position/core.js index f5c784242..dac56f5b9 100644 --- a/tests/unit/position/core.js +++ b/tests/unit/position/core.js @@ -5,6 +5,7 @@ define( [ "lib/helper", "ui/position" ], function( QUnit, $, common, helper ) { +"use strict"; var win = $( window ), scrollTopSupport = function() { @@ -23,8 +24,6 @@ QUnit.module( "position", { afterEach: helper.moduleAfterEach } ); -common.testJshint( "position" ); - QUnit.test( "my, at, of", function( assert ) { assert.expect( 4 ); diff --git a/tests/unit/progressbar/core.js b/tests/unit/progressbar/core.js index cf9d0aba3..b79ee1f63 100644 --- a/tests/unit/progressbar/core.js +++ b/tests/unit/progressbar/core.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/progressbar" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "progressbar: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/progressbar/events.js b/tests/unit/progressbar/events.js index e1b33f0b2..3bdcd2bba 100644 --- a/tests/unit/progressbar/events.js +++ b/tests/unit/progressbar/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/progressbar" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "progressbar: events", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/progressbar/methods.js b/tests/unit/progressbar/methods.js index 8f168f786..4d6f3a039 100644 --- a/tests/unit/progressbar/methods.js +++ b/tests/unit/progressbar/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/progressbar" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "progressbar: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/progressbar/options.js b/tests/unit/progressbar/options.js index fa88ae3c2..bb7450db0 100644 --- a/tests/unit/progressbar/options.js +++ b/tests/unit/progressbar/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/progressbar" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "progressbar: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/resizable/core.js b/tests/unit/resizable/core.js index a2fb60006..b3c61514a 100644 --- a/tests/unit/resizable/core.js +++ b/tests/unit/resizable/core.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/resizable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "resizable: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/resizable/events.js b/tests/unit/resizable/events.js index 3a94d7e52..1822247f5 100644 --- a/tests/unit/resizable/events.js +++ b/tests/unit/resizable/events.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/resizable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "resizable: events", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/resizable/helper.js b/tests/unit/resizable/helper.js index 2b8c2b46d..0c9c13959 100644 --- a/tests/unit/resizable/helper.js +++ b/tests/unit/resizable/helper.js @@ -3,6 +3,7 @@ define( [ "jquery", "lib/helper" ], function( QUnit, $, helper ) { +"use strict"; return $.extend( helper, { drag: function( el, dx, dy ) { diff --git a/tests/unit/resizable/methods.js b/tests/unit/resizable/methods.js index 8bdc08c11..c00687b58 100644 --- a/tests/unit/resizable/methods.js +++ b/tests/unit/resizable/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/resizable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "resizable: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/resizable/options.js b/tests/unit/resizable/options.js index ec5a8c010..d85840562 100644 --- a/tests/unit/resizable/options.js +++ b/tests/unit/resizable/options.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/resizable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "resizable: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/selectable/events.js b/tests/unit/selectable/events.js index 1ef45264e..5f1a512bf 100644 --- a/tests/unit/selectable/events.js +++ b/tests/unit/selectable/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectable" ], function( QUnit, $, testHelpers ) { +"use strict"; QUnit.module( "selectable: events", { afterEach: testHelpers.moduleAfterEach } ); diff --git a/tests/unit/selectable/methods.js b/tests/unit/selectable/methods.js index d0dc23e69..377ac6150 100644 --- a/tests/unit/selectable/methods.js +++ b/tests/unit/selectable/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectable: methods", { afterEach: helper.moduleAfterEach } ); @@ -53,7 +54,9 @@ QUnit.test( "enable", function( assert ) { el.selectable( { disabled: true, - start: function() { fired = true; } + start: function() { + fired = true; + } } ); el.simulate( "drag", { dx: 20, diff --git a/tests/unit/selectable/options.js b/tests/unit/selectable/options.js index 02c0d2b2a..6c9e84901 100644 --- a/tests/unit/selectable/options.js +++ b/tests/unit/selectable/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectable: options", { afterEach: helper.moduleAfterEach } ); @@ -13,7 +14,9 @@ QUnit.test( "autoRefresh", function( assert ) { var actual = 0, el = $( "#selectable1" ), sel = $( "*", el ), - selected = function() { actual += 1; }; + selected = function() { + actual += 1; + }; el = $( "#selectable1" ).selectable( { autoRefresh: false, selected: selected } ); sel.hide(); @@ -51,7 +54,9 @@ QUnit.test( "filter", function( assert ) { var actual = 0, el = $( "#selectable1" ), sel = $( "*", el ), - selected = function() { actual += 1; }; + selected = function() { + actual += 1; + }; el = $( "#selectable1" ).selectable( { filter: ".special", selected: selected } ); el.simulate( "drag", { diff --git a/tests/unit/selectmenu/core.js b/tests/unit/selectmenu/core.js index 0c1c3979a..05a0e6301 100644 --- a/tests/unit/selectmenu/core.js +++ b/tests/unit/selectmenu/core.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectmenu" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectmenu: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/selectmenu/events.js b/tests/unit/selectmenu/events.js index 90f40895b..108ac500b 100644 --- a/tests/unit/selectmenu/events.js +++ b/tests/unit/selectmenu/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectmenu" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectmenu: events", { beforeEach: function() { diff --git a/tests/unit/selectmenu/methods.js b/tests/unit/selectmenu/methods.js index 0785d48ad..31c2a2a2b 100644 --- a/tests/unit/selectmenu/methods.js +++ b/tests/unit/selectmenu/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectmenu" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectmenu: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/selectmenu/options.js b/tests/unit/selectmenu/options.js index b41f120db..4a070f4eb 100644 --- a/tests/unit/selectmenu/options.js +++ b/tests/unit/selectmenu/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/selectmenu" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "selectmenu: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/slider/core.js b/tests/unit/slider/core.js index 289ddfdd7..933a68eff 100644 --- a/tests/unit/slider/core.js +++ b/tests/unit/slider/core.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/slider" ], function( QUnit, $, helper ) { +"use strict"; var element, options; @@ -68,7 +69,7 @@ QUnit.test( "keydown HOME on handle sets value to min", function( assert ) { element.slider( "value", 0 ); handle().simulate( "keydown", { keyCode: $.ui.keyCode.HOME } ); - assert.equal( element.slider( "value" ), options.min ) ; + assert.equal( element.slider( "value" ), options.min ); element.slider( "destroy" ); } ); @@ -87,7 +88,7 @@ QUnit.test( "keydown END on handle sets value to max", function( assert ) { element.slider( "value", 0 ); handle().simulate( "keydown", { keyCode: $.ui.keyCode.END } ); - assert.equal( element.slider( "value" ), options.max ) ; + assert.equal( element.slider( "value" ), options.max ); element.slider( "destroy" ); diff --git a/tests/unit/slider/events.js b/tests/unit/slider/events.js index 7250a9ceb..3b283d281 100644 --- a/tests/unit/slider/events.js +++ b/tests/unit/slider/events.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/slider" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "slider: events", { afterEach: helper.moduleAfterEach } ); @@ -124,16 +125,16 @@ QUnit.test( "mouse based interaction part two: when handles overlap", function( start: function( event, ui ) { assert.equal( handles.index( ui.handle ), 0, "leftmost handle activated when overlapping at maximum" ); } - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); handles.eq( 0 ).simulate( "drag", { dx: -10 } ); element.slider( "destroy" ); element = $( "#slider1" ) .slider( { values: [ 19, 20 ] - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); handles.eq( 0 ).simulate( "drag", { dx: 10 } ); element.one( "slidestart", function( event, ui ) { assert.equal( handles.index( ui.handle ), 0, "left handle activated if left was moved last" ); @@ -144,8 +145,8 @@ QUnit.test( "mouse based interaction part two: when handles overlap", function( element = $( "#slider1" ) .slider( { values: [ 19, 20 ] - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); handles.eq( 1 ).simulate( "drag", { dx: -10 } ); element.one( "slidestart", function( event, ui ) { assert.equal( handles.index( ui.handle ), 1, "right handle activated if right was moved last (#3467)" ); @@ -158,8 +159,8 @@ QUnit.test( "mouse based interaction part two: when handles overlap", function( min: 0, max: 100, values: [ 0, 50 ] - } ), - handles = element.find( ".ui-slider-handle" ); + } ); + handles = element.find( ".ui-slider-handle" ); element.slider( "option", { values: [ 100, 100 ] } ); handles.eq( 0 ).simulate( "drag", { dx: -10 } ); diff --git a/tests/unit/slider/methods.js b/tests/unit/slider/methods.js index a2685c60d..b6808c3b2 100644 --- a/tests/unit/slider/methods.js +++ b/tests/unit/slider/methods.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/slider" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "slider: methods", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/slider/options.js b/tests/unit/slider/options.js index e8a9b4208..40b6bab22 100644 --- a/tests/unit/slider/options.js +++ b/tests/unit/slider/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/slider" ], function( QUnit, $, helper ) { +"use strict"; var element, options; @@ -147,7 +148,7 @@ QUnit.test( "orientation", function( assert ) { assert.equal( element.find( ".ui-slider-handle" )[ 0 ].style.bottom, "", "CSS bottom reset" ); assert.equal( handle()[ 0 ].style.left, percentVal + "%", "horizontal slider handle is positioned with left: %" ); - element.slider( "destroy" ) ; + element.slider( "destroy" ); options = { max: 2, diff --git a/tests/unit/sortable/core.js b/tests/unit/sortable/core.js index f6a26bb3b..90ec1bd76 100644 --- a/tests/unit/sortable/core.js +++ b/tests/unit/sortable/core.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/sortable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "sortable: core", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/sortable/events.js b/tests/unit/sortable/events.js index 854c1cfa4..0e26603d2 100644 --- a/tests/unit/sortable/events.js +++ b/tests/unit/sortable/events.js @@ -6,6 +6,7 @@ define( [ "ui/widgets/sortable", "ui/widgets/draggable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "sortable: events", { afterEach: helper.moduleAfterEach } ); @@ -183,7 +184,9 @@ QUnit.test( "#4752: link event firing on sortable with connect list", function( assert.expect( 10 ); var fired = {}, - hasFired = function( type ) { return ( type in fired ) && ( true === fired[ type ] ); }; + hasFired = function( type ) { + return ( type in fired ) && ( true === fired[ type ] ); + }; $( "#sortable" ).clone().attr( "id", "sortable2" ).insertAfter( "#sortable" ); diff --git a/tests/unit/sortable/methods.js b/tests/unit/sortable/methods.js index e04fd08ae..534dd53b1 100644 --- a/tests/unit/sortable/methods.js +++ b/tests/unit/sortable/methods.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/sortable" ], function( QUnit, $, helper, testHelper ) { +"use strict"; QUnit.module( "sortable: methods", { afterEach: helper.moduleAfterEach } ); @@ -62,7 +63,7 @@ QUnit.test( "enable", function( assert ) { testHelper.sort( assert, $( "li", el )[ 0 ], 0, 44, 2, ".sortable('option', 'disabled', false)" ); - expected = $( "<div></div>" ).sortable(), + expected = $( "<div></div>" ).sortable(); actual = expected.sortable( "enable" ); assert.equal( actual, expected, "enable is chainable" ); } ); diff --git a/tests/unit/sortable/options.js b/tests/unit/sortable/options.js index 49f0744ab..8af1a2682 100644 --- a/tests/unit/sortable/options.js +++ b/tests/unit/sortable/options.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/sortable" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "sortable: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/spinner/core.js b/tests/unit/spinner/core.js index 6c8c9bdf3..e9f7bc3d2 100644 --- a/tests/unit/spinner/core.js +++ b/tests/unit/spinner/core.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/spinner" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var simulateKeyDownUp = testHelper.simulateKeyDownUp; diff --git a/tests/unit/spinner/deprecated.js b/tests/unit/spinner/deprecated.js index f259ceb2e..79700d116 100644 --- a/tests/unit/spinner/deprecated.js +++ b/tests/unit/spinner/deprecated.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/spinner" ], function( QUnit, $, helper ) { +"use strict"; var originalSpinner = $.ui.spinner.prototype; QUnit.module( "spinner: deprecated", { diff --git a/tests/unit/spinner/events.js b/tests/unit/spinner/events.js index 9583a9ec2..833b12adf 100644 --- a/tests/unit/spinner/events.js +++ b/tests/unit/spinner/events.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/spinner" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var simulateKeyDownUp = testHelper.simulateKeyDownUp; diff --git a/tests/unit/spinner/methods.js b/tests/unit/spinner/methods.js index 8af1a6b6e..3ba8b69d1 100644 --- a/tests/unit/spinner/methods.js +++ b/tests/unit/spinner/methods.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/spinner" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var simulateKeyDownUp = testHelper.simulateKeyDownUp; diff --git a/tests/unit/spinner/options.js b/tests/unit/spinner/options.js index 7d802b2a4..51d8589fd 100644 --- a/tests/unit/spinner/options.js +++ b/tests/unit/spinner/options.js @@ -6,6 +6,7 @@ define( [ "globalize", "globalize/ja-JP" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "spinner: options", { afterEach: helper.moduleAfterEach } ); diff --git a/tests/unit/subsuite.js b/tests/unit/subsuite.js index 77dc4a943..8d594588c 100644 --- a/tests/unit/subsuite.js +++ b/tests/unit/subsuite.js @@ -1,4 +1,5 @@ ( function() { +"use strict"; var versions = [ "1.8.0", "1.8.1", "1.8.2", "1.8.3", @@ -33,4 +34,4 @@ window.testAllVersions = function( widget ) { } ) ); }; -}() ); +} )(); diff --git a/tests/unit/tabs/core.js b/tests/unit/tabs/core.js index 43392bdb4..8d4322463 100644 --- a/tests/unit/tabs/core.js +++ b/tests/unit/tabs/core.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/tabs" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var state = testHelper.state; diff --git a/tests/unit/tabs/events.js b/tests/unit/tabs/events.js index 9f7e92d8f..70510d7d6 100644 --- a/tests/unit/tabs/events.js +++ b/tests/unit/tabs/events.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/tabs" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var state = testHelper.state; diff --git a/tests/unit/tabs/methods.js b/tests/unit/tabs/methods.js index c67d76a31..e447d7623 100644 --- a/tests/unit/tabs/methods.js +++ b/tests/unit/tabs/methods.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/tabs" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var disabled = testHelper.disabled, state = testHelper.state; diff --git a/tests/unit/tabs/options.js b/tests/unit/tabs/options.js index 8414f7976..774a24d17 100644 --- a/tests/unit/tabs/options.js +++ b/tests/unit/tabs/options.js @@ -5,6 +5,7 @@ define( [ "./helper", "ui/widgets/tabs" ], function( QUnit, $, helper, testHelper ) { +"use strict"; var disabled = testHelper.disabled, equalHeight = testHelper.equalHeight, diff --git a/tests/unit/tooltip/core.js b/tests/unit/tooltip/core.js index c50164efa..5ce49aeb7 100644 --- a/tests/unit/tooltip/core.js +++ b/tests/unit/tooltip/core.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/tooltip" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; diff --git a/tests/unit/tooltip/deprecated.js b/tests/unit/tooltip/deprecated.js index b44b8dcd6..4d3975e84 100644 --- a/tests/unit/tooltip/deprecated.js +++ b/tests/unit/tooltip/deprecated.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/tooltip" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; diff --git a/tests/unit/tooltip/events.js b/tests/unit/tooltip/events.js index 1e83c5255..16d1e08cb 100644 --- a/tests/unit/tooltip/events.js +++ b/tests/unit/tooltip/events.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/tooltip" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; diff --git a/tests/unit/tooltip/helper.js b/tests/unit/tooltip/helper.js index 01d4c03ac..8bc999157 100644 --- a/tests/unit/tooltip/helper.js +++ b/tests/unit/tooltip/helper.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widgets/tooltip" ], function( QUnit, $, helper ) { + "use strict"; return $.extend( helper, { beforeAfterEach: function() { @@ -13,10 +14,8 @@ define( [ timers = jQuery.timers; jQuery.fx.stop(); - var x = false; for ( index = timers.length; index--; ) { - x = true; timer = timers[ index ]; timer.anim.stop(); timers.splice( index, 1 ); diff --git a/tests/unit/tooltip/methods.js b/tests/unit/tooltip/methods.js index d71c5e0a6..b7a512ad1 100644 --- a/tests/unit/tooltip/methods.js +++ b/tests/unit/tooltip/methods.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/tooltip" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; diff --git a/tests/unit/tooltip/options.js b/tests/unit/tooltip/options.js index b9c056388..72a3cf889 100644 --- a/tests/unit/tooltip/options.js +++ b/tests/unit/tooltip/options.js @@ -4,6 +4,7 @@ define( [ "./helper", "ui/widgets/tooltip" ], function( QUnit, $, testHelper ) { +"use strict"; var beforeAfterEach = testHelper.beforeAfterEach; @@ -103,7 +104,7 @@ QUnit.test( "content: async callback loses focus before load", function( assert } ); QUnit.test( "content: change while open", function( assert ) { - assert.expect( 2 ) ; + assert.expect( 2 ); var element = $( "#tooltipped1" ).tooltip( { content: function() { return "old"; diff --git a/tests/unit/widget/animation.js b/tests/unit/widget/animation.js index dcacec75c..11d141369 100644 --- a/tests/unit/widget/animation.js +++ b/tests/unit/widget/animation.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widget" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "widget animation", ( function() { var show = $.fn.show, @@ -30,7 +31,7 @@ QUnit.module( "widget animation", ( function() { return helper.moduleAfterEach.apply( this, arguments ); } }; -}() ) ); +} )() ); QUnit.test( "show: null", function( assert ) { var ready = assert.async(); diff --git a/tests/unit/widget/classes.js b/tests/unit/widget/classes.js index 357283b5e..609f99032 100644 --- a/tests/unit/widget/classes.js +++ b/tests/unit/widget/classes.js @@ -4,6 +4,7 @@ define( [ "lib/helper", "ui/widget" ], function( QUnit, $, helper ) { +"use strict"; QUnit.module( "widget factory classes", { beforeEach: function() { diff --git a/tests/unit/widget/core.js b/tests/unit/widget/core.js index 9e69a9253..e36459f72 100644 --- a/tests/unit/widget/core.js +++ b/tests/unit/widget/core.js @@ -5,6 +5,7 @@ define( [ "lib/helper", "ui/widget" ], function( QUnit, $, common, helper ) { +"use strict"; QUnit.module( "widget factory", { afterEach: function() { @@ -16,8 +17,6 @@ QUnit.module( "widget factory", { } } ); -common.testJshint( "widget" ); - QUnit.test( "widget creation", function( assert ) { assert.expect( 5 ); var method, @@ -1443,7 +1442,7 @@ QUnit.test( "._trigger() - instance as element", function( assert ) { .trigger( "remove" ); } ); } ); -}() ); +} )(); QUnit.test( "redefine", function( assert ) { assert.expect( 4 ); diff --git a/tests/unit/widget/extend.js b/tests/unit/widget/extend.js index b27d925f0..ea2707ef3 100644 --- a/tests/unit/widget/extend.js +++ b/tests/unit/widget/extend.js @@ -3,6 +3,7 @@ define( [ "jquery", "ui/widget" ], function( QUnit, $ ) { +"use strict"; QUnit.test( "$.widget.extend()", function( assert ) { assert.expect( 28 ); @@ -75,7 +76,7 @@ QUnit.test( "$.widget.extend()", function( assert ) { assert.strictEqual( nullUndef.xnumber0, null, "Check to make sure null values are inserted" ); target = {}; - recursive = { foo:target, bar:5 }; + recursive = { foo: target, bar: 5 }; $.widget.extend( target, recursive ); assert.deepEqual( target, { foo: {}, bar: 5 }, "Check to make sure a recursive obj doesn't go never-ending loop by not copying it over" ); @@ -92,7 +93,7 @@ QUnit.test( "$.widget.extend()", function( assert ) { assert.strictEqual( ret.foo, null, "Make sure a null value doesn't crash with deep extend, for #1908" ); obj = { foo: null }; - $.widget.extend( obj, { foo:"notnull" } ); + $.widget.extend( obj, { foo: "notnull" } ); assert.equal( obj.foo, "notnull", "Make sure a null value can be overwritten" ); settings = $.widget.extend( {}, defaults, options1, options2 ); |