diff options
author | Scott González <scott.gonzalez@gmail.com> | 2009-11-09 01:50:23 +0000 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2009-11-09 01:50:23 +0000 |
commit | b3a095d3ef7a186fe27fe19a0a40eeb496978284 (patch) | |
tree | 03dadba8a399ab3457406a7de5c3f507bc92baf5 /tests/unit/tabs | |
parent | b0733bbe59c17e49dcc8ee6dc98efe15c0c4ca8e (diff) | |
download | jquery-ui-b3a095d3ef7a186fe27fe19a0a40eeb496978284.tar.gz jquery-ui-b3a095d3ef7a186fe27fe19a0a40eeb496978284.zip |
Removed use of .data() for getting/setting options in tests; using each plugin's option method instead. Fixes #4853 - Remove use of .data() for options in tests.
Diffstat (limited to 'tests/unit/tabs')
-rw-r--r-- | tests/unit/tabs/tabs_methods.js | 22 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_options.js | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js index 941a7b517..b1b5462a6 100644 --- a/tests/unit/tabs/tabs_methods.js +++ b/tests/unit/tabs/tabs_methods.js @@ -16,7 +16,7 @@ test('init', function() { ok( $('div:eq(0)', el).is('.ui-tabs-panel.ui-widget-content.ui-corner-bottom'), 'attach classes to panel' ); ok( $('li:eq(0)', el).is('.ui-tabs-selected.ui-state-active.ui-corner-top'), 'attach classes to active li'); ok( $('li:eq(1)', el).is('.ui-state-default.ui-corner-top'), 'attach classes to inactive li'); - equals( el.data('selected.tabs'), 0, 'selected.tabs set' ); + equals( el.tabs('option', 'selected'), 0, 'selected option set' ); equals( $('li', el).index( $('li.ui-tabs-selected', el) ), 0, 'second tab active'); equals( $('div', el).index( $('div.ui-tabs-hide', '#tabs1') ), 1, 'second panel should be hidden' ); }); @@ -77,7 +77,7 @@ test('remove', function() { el.tabs('select', 1); el.tabs('remove', 1); - equals(el.data('selected.tabs'), 0, 'update selected property'); + equals(el.tabs('option', 'selected'), 0, 'update selected property'); }); test('select', function() { @@ -86,36 +86,36 @@ test('select', function() { el = $('#tabs1').tabs(); el.tabs('select', 1); - equals(el.data('selected.tabs'), 1, 'should select tab'); + equals(el.tabs('option', 'selected'), 1, 'should select tab'); el.tabs('destroy'); el.tabs({ collapsible: true }); el.tabs('select', 0); - equals(el.data('selected.tabs'), -1, 'should collapse tab passing in the already selected tab'); + equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in the already selected tab'); el.tabs('destroy'); el.tabs({ collapsible: true }); el.tabs('select', -1); - equals(el.data('selected.tabs'), -1, 'should collapse tab passing in -1'); + equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in -1'); el.tabs('destroy'); el.tabs({ collapsible: true }); el.tabs('select', null); - equals(el.data('selected.tabs'), -1, 'should collapse tab passing in null (deprecated)'); + equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in null (deprecated)'); el.tabs('select', null); - equals(el.data('selected.tabs'), -1, 'should not select tab passing in null a second time (deprecated)'); + equals(el.tabs('option', 'selected'), -1, 'should not select tab passing in null a second time (deprecated)'); el.tabs('destroy'); el.tabs(); el.tabs('select', 0); - equals(el.data('selected.tabs'), 0, 'should not collapse tab if collapsible is not set to true'); + equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true'); el.tabs('select', -1); - equals(el.data('selected.tabs'), 0, 'should not collapse tab if collapsible is not set to true'); + equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true'); el.tabs('select', null); - equals(el.data('selected.tabs'), 0, 'should not collapse tab if collapsible is not set to true'); + equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true'); el.tabs('select', '#fragment-2'); - equals(el.data('selected.tabs'), 1, 'should select tab by id'); + equals(el.tabs('option', 'selected'), 1, 'should select tab by id'); }); test('load', function() { diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index e6554f6ce..0b79f87ef 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -19,11 +19,11 @@ test('collapsible', function() { el = $('#tabs1'); el.tabs({ collapsible: true }); - equals(el.data('collapsible.tabs'), true, 'option set'); + equals(el.tabs('option', 'collapsible'), true, 'option set'); ok(el.is('.ui-tabs-collapsible'), 'extra class "ui-tabs-collapsible" attached'); el.tabs('select', 0); equals($('div.ui-tabs-hide', '#tabs1').length, 3, 'all panels should be hidden'); - el.data('collapsible.tabs', false); + el.tabs('option', 'collapsible', false); ok(el.is(':not(.ui-tabs-collapsible)'), 'extra class "ui-tabs-collapsible" not attached'); }); @@ -70,11 +70,11 @@ test('deselectable (deprecated)', function() { el = $('#tabs1'); el.tabs({ deselectable: true }); - equals(el.data('collapsible.tabs'), true, 'option set'); + equals(el.tabs('option', 'collapsible'), true, 'option set'); ok(el.is('.ui-tabs-collapsible'), 'extra class "ui-tabs-collapsible" attached'); el.tabs('select', 0); equals($('div.ui-tabs-hide', '#tabs1').length, 3, 'all panels should be hidden'); - el.data('deselectable.tabs', false); + el.tabs('option', 'deselectable', false); ok(el.is(':not(.ui-tabs-collapsible)'), 'extra class "ui-tabs-collapsible" not attached'); }); @@ -103,30 +103,30 @@ test('selected', function() { expect(8); el = $('#tabs1').tabs(); - equals(el.data('selected.tabs'), 0, 'should be 0 by default'); + equals(el.tabs('option', 'selected'), 0, 'should be 0 by default'); el.tabs('destroy'); el.tabs({ selected: -1 }); - equals(el.data('selected.tabs'), -1, 'should be -1 for all tabs unselected'); + equals(el.tabs('option', 'selected'), -1, 'should be -1 for all tabs unselected'); equals( $('li.ui-tabs-selected', el).length, 0, 'no tab should be selected' ); equals( $('div.ui-tabs-hide', '#tabs1').length, 3, 'all panels should be hidden' ); el.tabs('destroy'); el.tabs({ selected: null }); - equals(el.data('selected.tabs'), -1, 'should be -1 for all tabs unselected with value null (deprecated)'); + equals(el.tabs('option', 'selected'), -1, 'should be -1 for all tabs unselected with value null (deprecated)'); el.tabs('destroy'); el.tabs({ selected: 1 }); - equals(el.data('selected.tabs'), 1, 'should be specified tab'); + equals(el.tabs('option', 'selected'), 1, 'should be specified tab'); el.tabs('destroy'); el.tabs({ selected: 99 }); - equals(el.data('selected.tabs'), 0, 'selected should default to zero if given value is out of index'); + equals(el.tabs('option', 'selected'), 0, 'selected should default to zero if given value is out of index'); el.tabs('destroy'); el.tabs({ collapsible: true }); - el.data('selected.tabs', 0); - equals(el.data('selected.tabs'), 0, 'should not collapse tab if value is same as selected'); + el.tabs('option', 'selected', 0); + equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if value is same as selected'); }); test('spinner', function() { |