diff options
author | Alexander Schmitz <arschmitz@gmail.com> | 2015-01-07 21:51:38 -0500 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-10-08 14:02:35 -0400 |
commit | 16abde399daa07e11f3b972ab675d59374cf08be (patch) | |
tree | df9f2ef654f5357ad1e7e1eac3ad6f79194b33f1 /tests/unit/checkboxradio | |
parent | 9f7f0a427966741a460e91336947698879f8ad77 (diff) | |
download | jquery-ui-16abde399daa07e11f3b972ab675d59374cf08be.tar.gz jquery-ui-16abde399daa07e11f3b972ab675d59374cf08be.zip |
Spinner: Updates for new button widget and classes option
Diffstat (limited to 'tests/unit/checkboxradio')
-rw-r--r-- | tests/unit/checkboxradio/common.js | 2 | ||||
-rw-r--r-- | tests/unit/checkboxradio/core.js | 2 | ||||
-rw-r--r-- | tests/unit/checkboxradio/events.js | 72 | ||||
-rw-r--r-- | tests/unit/checkboxradio/methods.js | 2 | ||||
-rw-r--r-- | tests/unit/checkboxradio/options.js | 2 |
5 files changed, 5 insertions, 75 deletions
diff --git a/tests/unit/checkboxradio/common.js b/tests/unit/checkboxradio/common.js index 6a739435f..0dd663d07 100644 --- a/tests/unit/checkboxradio/common.js +++ b/tests/unit/checkboxradio/common.js @@ -1,6 +1,6 @@ define( [ "lib/common", - "ui/checkboxradio" + "ui/widgets/checkboxradio" ], function( common ) { common.testWidget( "checkboxradio", { diff --git a/tests/unit/checkboxradio/core.js b/tests/unit/checkboxradio/core.js index e70ca58c1..70ed4bb69 100644 --- a/tests/unit/checkboxradio/core.js +++ b/tests/unit/checkboxradio/core.js @@ -1,6 +1,6 @@ define( [ "jquery", - "ui/checkboxradio" + "ui/widgets/checkboxradio" ], function( $ ) { module( "Checkboxradio: core" ); diff --git a/tests/unit/checkboxradio/events.js b/tests/unit/checkboxradio/events.js index e5909a386..ad7f1e75f 100644 --- a/tests/unit/checkboxradio/events.js +++ b/tests/unit/checkboxradio/events.js @@ -1,80 +1,10 @@ define( [ "jquery", - "ui/checkboxradio" + "ui/widgets/checkboxradio" ], function( $ ) { module( "Checkboxradio: events" ); -asyncTest( "form reset / click", function( assert ) { - expect( 35 ); - - var radios = [ - $( "#radio11" ).checkboxradio(), - $( "#radio12" ).checkboxradio(), - $( "#radio13" ).checkboxradio() - ], - widgets = [ - radios[ 0 ].checkboxradio( "widget" ), - radios[ 1 ].checkboxradio( "widget" ), - radios[ 2 ].checkboxradio( "widget" ) - ], - form1 = $( "#form1" ), - form2 = $( "#form2" ); - - // Checkes that only the specified radio is checked in the group - function assertChecked( checked ) { - $.each( widgets, function( index ) { - var method = index === checked ? "hasClasses" : "lacksClasses"; - - assert[ method ]( widgets[ index ], "ui-checkboxradio-checked ui-state-active" ); - } ); - } - - // Checks the form count on each form - function assertFormCount( count ) { - equal( form1.data( "uiCheckboxradioCount" ), count, "Form1 has a count of " + count ); - equal( form2.data( "uiCheckboxradioCount" ), 3, "Form2 has a count of 3" ); - } - - // Run the tests - function testForms( current, start ) { - assertChecked( 2 ); - - if ( !start && current !== 0 ) { - radios[ current - 1 ].checkboxradio( "destroy" ); - } - - assertFormCount( 3 - current ); - - radios[ current ].prop( "checked", true ); - radios[ current ].trigger( "change" ); - assertChecked( current ); - - form1.trigger( "reset" ); - } - - // Recoursivly run the tests in a setTimeout with call back for the resets - function iterate( i ) { - setTimeout( function() { - if ( i < 3 ) { - testForms( i ); - iterate( i + 1 ); - return; - } - radios[ 2 ].checkboxradio( "destroy" ); - assertChecked( false ); - start(); - } ); - } - - $( "#form2 input" ).checkboxradio(); - - // Check the starting state then kick everything off - testForms( 0, true ); - iterate( 0 ); - -} ); - asyncTest( "Resetting a checkbox's form should refresh the visual state of the checkbox", function( assert ) { diff --git a/tests/unit/checkboxradio/methods.js b/tests/unit/checkboxradio/methods.js index f189c9eea..c0ce9fde6 100644 --- a/tests/unit/checkboxradio/methods.js +++ b/tests/unit/checkboxradio/methods.js @@ -1,6 +1,6 @@ define( [ "jquery", - "ui/checkboxradio" + "ui/widgets/checkboxradio" ], function( $ ) { module( "Checkboxradio: methods" ); diff --git a/tests/unit/checkboxradio/options.js b/tests/unit/checkboxradio/options.js index 11bd072ca..1998ff54e 100644 --- a/tests/unit/checkboxradio/options.js +++ b/tests/unit/checkboxradio/options.js @@ -1,6 +1,6 @@ define( [ "jquery", - "ui/checkboxradio" + "ui/widgets/checkboxradio" ], function( $ ) { module( "Checkboxradio: options" ); |