Skip to content
Permalink
Browse files

Tests: Cleanup.

  • Loading branch information
scottgonzalez committed Aug 4, 2011
1 parent cff6b56 commit 6fb68568bea4fcaf0caff77363819b3d7c732cd4
@@ -50,17 +50,17 @@ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
<div class="foo">
<p>
You've seen it coming!
<br/>
<br>
Buy now and get nothing for free!
<br/>
<br>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
<div class="foo">
<p>
your bear, you have to admit it!
<br/>
<br>
No, we aren't selling bears.
</p>
<p>
@@ -48,17 +48,17 @@ <h3 class="bar"><a class="anchor">There is one obvious advantage:</a></h3>
<div class="foo">
<p>
You've seen it coming!
<br/>
<br>
Buy now and get nothing for free!
<br/>
<br>
Well, at least no free beer. Perhaps a bear, if you can afford it.
</p>
</div>
<h3 class="bar"><a class="anchor">Now that you've got...</a></h3>
<div class="foo">
<p>
your bear, you have to admit it!
<br/>
<br>
No, we aren't selling bears.
</p>
<p>
@@ -37,7 +37,7 @@ <h2 id="qunit-userAgent"></h2>
<div id="qunit-fixture">

<div id="ac-wrap1" class="ac-wrap"></div>
<div id="ac-wrap2" class="ac-wrap"><input id="autocomplete" class="foo" /></div>
<div id="ac-wrap2" class="ac-wrap"><input id="autocomplete" class="foo"></div>
<div id="autocomplete-contenteditable" contenteditable="" tabindex=0></div>

</div>
@@ -29,23 +29,23 @@ test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard
});

test( "#7092 - button creation that requires a matching label does not find label in all cases", function() {
var group = $( "<span><label for='t7092a'/><input type='checkbox' id='t7092a'/></span>" );
var group = $( "<span><label for='t7092a'></label><input type='checkbox' id='t7092a'></span>" );
group.find( "input:checkbox" ).button();
ok( group.find( "label" ).is( ".ui-button" ) );

group = $( "<input type='checkbox' id='t7092b'/><label for='t7092b'/>" );
group = $( "<input type='checkbox' id='t7092b'><label for='t7092b'></label>" );
group.filter( "input:checkbox" ).button();
ok( group.filter( "label" ).is( ".ui-button" ) );

group = $( "<span><input type='checkbox' id='t7092c'/></span><label for='t7092c'/>" );
group = $( "<span><input type='checkbox' id='t7092c'></span><label for='t7092c'></label>" );
group.find( "input:checkbox" ).button();
ok( group.filter( "label" ).is( ".ui-button" ) );

group = $( "<span><input type='checkbox' id='t7092d'/></span><span><label for='t7092d'/></span>" );
group = $( "<span><input type='checkbox' id='t7092d'></span><span><label for='t7092d'></label></span>" );
group.find( "input:checkbox" ).button();
ok( group.find( "label" ).is( ".ui-button" ) );

group = $( "<input type='checkbox' id='t7092e'/><span><label for='t7092e'/></span>" );
group = $( "<input type='checkbox' id='t7092e'><span><label for='t7092e'></label></span>" );
group.filter( "input:checkbox" ).button();
ok( group.find( "label" ).is( ".ui-button" ) );
});
@@ -47,12 +47,12 @@ <h2 id="qunit-userAgent"></h2>
</map>

<div>
<input id="visibleAncestor-inputTypeNone" />
<input type="text" id="visibleAncestor-inputTypeText" />
<input type="checkbox" id="visibleAncestor-inputTypeCheckbox" />
<input type="radio" id="visibleAncestor-inputTypeRadio" />
<input type="button" id="visibleAncestor-inputTypeButton" />
<input type="hidden" id="visibleAncestor-inputTypeHidden" />
<input id="visibleAncestor-inputTypeNone">
<input type="text" id="visibleAncestor-inputTypeText">
<input type="checkbox" id="visibleAncestor-inputTypeCheckbox">
<input type="radio" id="visibleAncestor-inputTypeRadio">
<input type="button" id="visibleAncestor-inputTypeButton">
<input type="hidden" id="visibleAncestor-inputTypeHidden">
<button id="visibleAncestor-button">x</button>
<select id="visibleAncestor-select">
<option>option</option>
@@ -68,40 +68,40 @@ <h2 id="qunit-userAgent"></h2>
</div>

<div>
<input id="disabledElement-inputTypeNone" disabled="disabled" />
<input type="text" id="disabledElement-inputTypeText" disabled="disabled" />
<input type="checkbox" id="disabledElement-inputTypeCheckbox" disabled="disabled" />
<input type="radio" id="disabledElement-inputTypeRadio" disabled="disabled" />
<input type="button" id="disabledElement-inputTypeButton" disabled="disabled" />
<input type="hidden" id="disabledElement-inputTypeHidden" disabled="disabled" />
<input id="disabledElement-inputTypeNone" disabled="disabled">
<input type="text" id="disabledElement-inputTypeText" disabled="disabled">
<input type="checkbox" id="disabledElement-inputTypeCheckbox" disabled="disabled">
<input type="radio" id="disabledElement-inputTypeRadio" disabled="disabled">
<input type="button" id="disabledElement-inputTypeButton" disabled="disabled">
<input type="hidden" id="disabledElement-inputTypeHidden" disabled="disabled">
<button id="disabledElement-button" disabled="disabled"></button>
<select id="disabledElement-select" disabled="disabled"></select>
<textarea id="disabledElement-textarea" disabled="disabled"></textarea>
</div>

<div>
<div id="displayNoneAncestor" style="display: none;">
<input id="displayNoneAncestor-input" />
<input id="displayNoneAncestor-input">
<span tabindex="1" id="displayNoneAncestor-span">.</span>
</div>

<div id="visibilityHiddenAncestor" style="visibility: hidden;">
<input id="visibilityHiddenAncestor-input" />
<input id="visibilityHiddenAncestor-input">
<span tabindex="1" id="visibilityHiddenAncestor-span">.</span>
</div>

<span tabindex="1" id="displayNone-span" style="display: none;">.</span>
<span tabindex="1" id="visibilityHidden-span" style="visibility: hidden;">.</span>

<input id="displayNone-input" style="display: none;" />
<input id="visibilityHidden-input" style="visibility: hidden;" />
<input id="displayNone-input" style="display: none;">
<input id="visibilityHidden-input" style="visibility: hidden;">
</div>

<div>
<input id="inputTabindex0" tabindex="0" />
<input id="inputTabindex10" tabindex="10" />
<input id="inputTabindex-1" tabindex="-1" />
<input id="inputTabindex-50" tabindex="-50" />
<input id="inputTabindex0" tabindex="0">
<input id="inputTabindex10" tabindex="10">
<input id="inputTabindex-1" tabindex="-1">
<input id="inputTabindex-50" tabindex="-50">

<span id="spanTabindex0" tabindex="0">.</span>
<span id="spanTabindex10" tabindex="10">.</span>
@@ -32,49 +32,49 @@ test("data", function() {
ok(!el.is(':data(test)'), msg);
}

el = $('<div/>');
el = $('<div>');
shouldNotHaveData('data never set');

el = $('<div/>').data('test', null);
el = $('<div>').data('test', null);
shouldNotHaveData('data is null');

el = $('<div/>').data('test', true);
el = $('<div>').data('test', true);
shouldHaveData('data set to true');

el = $('<div/>').data('test', false);
el = $('<div>').data('test', false);
shouldNotHaveData('data set to false');

el = $('<div/>').data('test', 0);
el = $('<div>').data('test', 0);
shouldNotHaveData('data set to 0');

el = $('<div/>').data('test', 1);
el = $('<div>').data('test', 1);
shouldHaveData('data set to 1');

el = $('<div/>').data('test', '');
el = $('<div>').data('test', '');
shouldNotHaveData('data set to empty string');

el = $('<div/>').data('test', 'foo');
el = $('<div>').data('test', 'foo');
shouldHaveData('data set to string');

el = $('<div/>').data('test', []);
el = $('<div>').data('test', []);
shouldHaveData('data set to empty array');

el = $('<div/>').data('test', [1]);
el = $('<div>').data('test', [1]);
shouldHaveData('data set to array');

el = $('<div/>').data('test', {});
el = $('<div>').data('test', {});
shouldHaveData('data set to empty object');

el = $('<div/>').data('test', {foo: 'bar'});
el = $('<div>').data('test', {foo: 'bar'});
shouldHaveData('data set to object');

el = $('<div/>').data('test', new Date());
el = $('<div>').data('test', new Date());
shouldHaveData('data set to date');

el = $('<div/>').data('test', /test/);
el = $('<div>').data('test', /test/);
shouldHaveData('data set to regexp');

el = $('<div/>').data('test', function() {});
el = $('<div>').data('test', function() {});
shouldHaveData('data set to function');
});

@@ -106,7 +106,7 @@ test("title id", function() {
equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
el.remove();

el = $('<div id="foo"/>').dialog();
el = $('<div id="foo">').dialog();
titleId = dlg().find('.ui-dialog-title').attr('id');
equals(titleId, 'ui-dialog-title-foo', 'carried over title id');
el.remove();
@@ -131,7 +131,7 @@ test("ARIA", function() {
});

test("widget method", function() {
var dialog = $("<div/>").appendTo("#main").dialog();
var dialog = $("<div>").appendTo("#main").dialog();
same(dialog.parent()[0], dialog.dialog("widget")[0]);
});

@@ -407,7 +407,7 @@ test("title", function() {
equals(el.dialog("option", "title"), "", "option not changed");
el.remove();

el = $('<div title="foo"/>').dialog();
el = $('<div title="foo">').dialog();
equals(titleText(), "foo", "title in element attribute");
equals(el.dialog("option", "title"), "foo", "option updated from attribute");
el.remove();
@@ -417,7 +417,7 @@ test("title", function() {
equals(el.dialog("option", "title"), "foo", "opiton set from options hash");
el.remove();

el = $('<div title="foo"/>').dialog({ title: 'bar' });
el = $('<div title="foo">').dialog({ title: 'bar' });
equals(titleText(), "bar", "title in init options should override title in element attribute");
equals(el.dialog("option", "title"), "bar", "opiton set from options hash");
el.remove();

0 comments on commit 6fb6856

Please sign in to comment.
You can’t perform that action at this time.