mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Tests: Enable QUnit.config.requireExpects.
This commit is contained in:
parent
9b6c1c5cdb
commit
5ae668fdb6
@ -8,6 +8,7 @@
|
|||||||
module("button: core");
|
module("button: core");
|
||||||
|
|
||||||
test("checkbox", function() {
|
test("checkbox", function() {
|
||||||
|
expect( 4 );
|
||||||
var input = $("#check"),
|
var input = $("#check"),
|
||||||
label = $("label[for=check]");
|
label = $("label[for=check]");
|
||||||
ok( input.is(":visible") );
|
ok( input.is(":visible") );
|
||||||
@ -18,6 +19,7 @@ test("checkbox", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("radios", function() {
|
test("radios", function() {
|
||||||
|
expect( 4 );
|
||||||
var inputs = $("#radio0 input"),
|
var inputs = $("#radio0 input"),
|
||||||
labels = $("#radio0 label");
|
labels = $("#radio0 label");
|
||||||
ok( inputs.is(":visible") );
|
ok( inputs.is(":visible") );
|
||||||
@ -34,6 +36,7 @@ function assert(noForm, form1, form2) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test("radio groups", function() {
|
test("radio groups", function() {
|
||||||
|
expect( 12 );
|
||||||
$("input[type=radio]").button();
|
$("input[type=radio]").button();
|
||||||
assert(":eq(0)", ":eq(1)", ":eq(2)");
|
assert(":eq(0)", ":eq(1)", ":eq(2)");
|
||||||
|
|
||||||
@ -51,6 +54,7 @@ test("radio groups", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("input type submit, don't create child elements", function() {
|
test("input type submit, don't create child elements", function() {
|
||||||
|
expect( 2 );
|
||||||
var input = $("#submit");
|
var input = $("#submit");
|
||||||
deepEqual( input.children().length, 0 );
|
deepEqual( input.children().length, 0 );
|
||||||
input.button();
|
input.button();
|
||||||
@ -58,6 +62,7 @@ test("input type submit, don't create child elements", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("buttonset", function() {
|
test("buttonset", function() {
|
||||||
|
expect( 6 );
|
||||||
var set = $("#radio1").buttonset();
|
var set = $("#radio1").buttonset();
|
||||||
ok( set.is(".ui-buttonset") );
|
ok( set.is(".ui-buttonset") );
|
||||||
deepEqual( set.children(".ui-button").length, 3 );
|
deepEqual( set.children(".ui-button").length, 3 );
|
||||||
@ -68,6 +73,7 @@ test("buttonset", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("buttonset (rtl)", function() {
|
test("buttonset (rtl)", function() {
|
||||||
|
expect( 6 );
|
||||||
var set,
|
var set,
|
||||||
parent = $("#radio1").parent();
|
parent = $("#radio1").parent();
|
||||||
// Set to rtl
|
// Set to rtl
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
module("button: options");
|
module("button: options");
|
||||||
|
|
||||||
test("disabled, explicit value", function() {
|
test("disabled, explicit value", function() {
|
||||||
|
expect( 4 );
|
||||||
$("#radio01").button({ disabled: false });
|
$("#radio01").button({ disabled: false });
|
||||||
deepEqual(false, $("#radio01").button("option", "disabled"),
|
deepEqual(false, $("#radio01").button("option", "disabled"),
|
||||||
"disabled option set to false");
|
"disabled option set to false");
|
||||||
@ -18,6 +19,7 @@ test("disabled, explicit value", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("disabled, null", function() {
|
test("disabled, null", function() {
|
||||||
|
expect( 4 );
|
||||||
$("#radio01").button({ disabled: null });
|
$("#radio01").button({ disabled: null });
|
||||||
deepEqual(false, $("#radio01").button("option", "disabled"),
|
deepEqual(false, $("#radio01").button("option", "disabled"),
|
||||||
"disabled option set to false");
|
"disabled option set to false");
|
||||||
@ -30,6 +32,7 @@ test("disabled, null", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("text false without icon", function() {
|
test("text false without icon", function() {
|
||||||
|
expect( 1 );
|
||||||
$("#button").button({
|
$("#button").button({
|
||||||
text: false
|
text: false
|
||||||
});
|
});
|
||||||
@ -39,6 +42,7 @@ test("text false without icon", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("text false with icon", function() {
|
test("text false with icon", function() {
|
||||||
|
expect( 1 );
|
||||||
$("#button").button({
|
$("#button").button({
|
||||||
text: false,
|
text: false,
|
||||||
icons: {
|
icons: {
|
||||||
@ -51,6 +55,7 @@ test("text false with icon", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("label, default", function() {
|
test("label, default", function() {
|
||||||
|
expect( 2 );
|
||||||
$("#button").button();
|
$("#button").button();
|
||||||
deepEqual( $("#button").text(), "Label" );
|
deepEqual( $("#button").text(), "Label" );
|
||||||
deepEqual( $( "#button").button( "option", "label" ), "Label" );
|
deepEqual( $( "#button").button( "option", "label" ), "Label" );
|
||||||
@ -59,6 +64,7 @@ test("label, default", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("label", function() {
|
test("label", function() {
|
||||||
|
expect( 2 );
|
||||||
$("#button").button({
|
$("#button").button({
|
||||||
label: "xxx"
|
label: "xxx"
|
||||||
});
|
});
|
||||||
@ -69,11 +75,13 @@ test("label", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("label default with input type submit", function() {
|
test("label default with input type submit", function() {
|
||||||
|
expect( 2 );
|
||||||
deepEqual( $("#submit").button().val(), "Label" );
|
deepEqual( $("#submit").button().val(), "Label" );
|
||||||
deepEqual( $("#submit").button( "option", "label" ), "Label" );
|
deepEqual( $("#submit").button( "option", "label" ), "Label" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("label with input type submit", function() {
|
test("label with input type submit", function() {
|
||||||
|
expect( 2 );
|
||||||
var label = $("#submit").button({
|
var label = $("#submit").button({
|
||||||
label: "xxx"
|
label: "xxx"
|
||||||
}).val();
|
}).val();
|
||||||
@ -82,6 +90,7 @@ test("label with input type submit", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("icons", function() {
|
test("icons", function() {
|
||||||
|
expect( 1 );
|
||||||
$("#button").button({
|
$("#button").button({
|
||||||
text: false,
|
text: false,
|
||||||
icons: {
|
icons: {
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
module( "button: tickets" );
|
module( "button: tickets" );
|
||||||
|
|
||||||
test( "#5946 - buttonset should ignore buttons that are not :visible", function() {
|
test( "#5946 - buttonset should ignore buttons that are not :visible", function() {
|
||||||
|
expect( 2 );
|
||||||
$( "#radio01" ).next().andSelf().hide();
|
$( "#radio01" ).next().andSelf().hide();
|
||||||
var set = $( "#radio0" ).buttonset({ items: "input[type=radio]:visible" });
|
var set = $( "#radio0" ).buttonset({ items: "input[type=radio]:visible" });
|
||||||
ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) );
|
ok( set.find( "label:eq(0)" ).is( ":not(.ui-button):not(.ui-corner-left)" ) );
|
||||||
@ -13,6 +14,7 @@ test( "#5946 - buttonset should ignore buttons that are not :visible", function(
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "#6262 - buttonset not applying ui-corner to invisible elements", function() {
|
test( "#6262 - buttonset not applying ui-corner to invisible elements", function() {
|
||||||
|
expect( 3 );
|
||||||
$( "#radio0" ).hide();
|
$( "#radio0" ).hide();
|
||||||
var set = $( "#radio0" ).buttonset();
|
var set = $( "#radio0" ).buttonset();
|
||||||
ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) );
|
ok( set.find( "label:eq(0)" ).is( ".ui-button.ui-corner-left" ) );
|
||||||
@ -21,6 +23,7 @@ test( "#6262 - buttonset not applying ui-corner to invisible elements", function
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() {
|
test( "#6711 Checkbox/Radiobutton do not Show Focused State when using Keyboard Navigation", function() {
|
||||||
|
expect( 2 );
|
||||||
var check = $( "#check" ).button(),
|
var check = $( "#check" ).button(),
|
||||||
label = $( "label[for='check']" );
|
label = $( "label[for='check']" );
|
||||||
ok( !label.is( ".ui-state-focus" ) );
|
ok( !label.is( ".ui-state-focus" ) );
|
||||||
@ -29,6 +32,7 @@ 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() {
|
test( "#7092 - button creation that requires a matching label does not find label in all cases", function() {
|
||||||
|
expect( 5 );
|
||||||
var group = $( "<span><label for='t7092a'></label><input type='checkbox' id='t7092a'></span>" );
|
var group = $( "<span><label for='t7092a'></label><input type='checkbox' id='t7092a'></span>" );
|
||||||
group.find( "input[type=checkbox]" ).button();
|
group.find( "input[type=checkbox]" ).button();
|
||||||
ok( group.find( "label" ).is( ".ui-button" ) );
|
ok( group.find( "label" ).is( ".ui-button" ) );
|
||||||
@ -51,6 +55,7 @@ test( "#7092 - button creation that requires a matching label does not find labe
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "#7534 - Button label selector works for ids with \":\"", function() {
|
test( "#7534 - Button label selector works for ids with \":\"", function() {
|
||||||
|
expect( 1 );
|
||||||
var group = $( "<span><input type='checkbox' id='check:7534'><label for='check:7534'>Label</label></span>" );
|
var group = $( "<span><input type='checkbox' id='check:7534'><label for='check:7534'>Label</label></span>" );
|
||||||
group.find( "input" ).button();
|
group.find( "input" ).button();
|
||||||
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
|
ok( group.find( "label" ).is( ".ui-button" ), "Found an id with a :" );
|
||||||
|
@ -28,6 +28,7 @@ asyncTest( "focus", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "zIndex", function() {
|
test( "zIndex", function() {
|
||||||
|
expect( 7 );
|
||||||
var el = $( "#zIndexAutoWithParent" ),
|
var el = $( "#zIndexAutoWithParent" ),
|
||||||
parent = el.parent();
|
parent = el.parent();
|
||||||
equal( el.zIndex(), 100, "zIndex traverses up to find value" );
|
equal( el.zIndex(), 100, "zIndex traverses up to find value" );
|
||||||
@ -46,6 +47,7 @@ test( "zIndex", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "innerWidth - getter", function() {
|
test( "innerWidth - getter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
equal( el.innerWidth(), 122, "getter passthru" );
|
equal( el.innerWidth(), 122, "getter passthru" );
|
||||||
@ -54,6 +56,7 @@ test( "innerWidth - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "innerWidth - setter", function() {
|
test( "innerWidth - setter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
el.innerWidth( 120 );
|
el.innerWidth( 120 );
|
||||||
@ -64,6 +67,7 @@ test( "innerWidth - setter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "innerHeight - getter", function() {
|
test( "innerHeight - getter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
equal( el.innerHeight(), 70, "getter passthru" );
|
equal( el.innerHeight(), 70, "getter passthru" );
|
||||||
@ -72,6 +76,7 @@ test( "innerHeight - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "innerHeight - setter", function() {
|
test( "innerHeight - setter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
el.innerHeight( 60 );
|
el.innerHeight( 60 );
|
||||||
@ -82,6 +87,7 @@ test( "innerHeight - setter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerWidth - getter", function() {
|
test( "outerWidth - getter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
equal( el.outerWidth(), 140, "getter passthru" );
|
equal( el.outerWidth(), 140, "getter passthru" );
|
||||||
@ -90,6 +96,7 @@ test( "outerWidth - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerWidth - setter", function() {
|
test( "outerWidth - setter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
el.outerWidth( 130 );
|
el.outerWidth( 130 );
|
||||||
@ -100,6 +107,7 @@ test( "outerWidth - setter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerWidth(true) - getter", function() {
|
test( "outerWidth(true) - getter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
equal( el.outerWidth(true), 154, "getter passthru w/ margin" );
|
equal( el.outerWidth(true), 154, "getter passthru w/ margin" );
|
||||||
@ -108,6 +116,7 @@ test( "outerWidth(true) - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerWidth(true) - setter", function() {
|
test( "outerWidth(true) - setter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
el.outerWidth( 130, true );
|
el.outerWidth( 130, true );
|
||||||
@ -118,6 +127,7 @@ test( "outerWidth(true) - setter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerHeight - getter", function() {
|
test( "outerHeight - getter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
equal( el.outerHeight(), 86, "getter passthru" );
|
equal( el.outerHeight(), 86, "getter passthru" );
|
||||||
@ -126,6 +136,7 @@ test( "outerHeight - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerHeight - setter", function() {
|
test( "outerHeight - setter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
el.outerHeight( 80 );
|
el.outerHeight( 80 );
|
||||||
@ -136,6 +147,7 @@ test( "outerHeight - setter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerHeight(true) - getter", function() {
|
test( "outerHeight(true) - getter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
equal( el.outerHeight(true), 98, "getter passthru w/ margin" );
|
equal( el.outerHeight(true), 98, "getter passthru w/ margin" );
|
||||||
@ -144,6 +156,7 @@ test( "outerHeight(true) - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "outerHeight(true) - setter", function() {
|
test( "outerHeight(true) - setter", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $( "#dimensions" );
|
var el = $( "#dimensions" );
|
||||||
|
|
||||||
el.outerHeight( 90, true );
|
el.outerHeight( 90, true );
|
||||||
@ -154,6 +167,7 @@ test( "outerHeight(true) - setter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "uniqueId / removeUniqueId", function() {
|
test( "uniqueId / removeUniqueId", function() {
|
||||||
|
expect( 3 );
|
||||||
var el = $( "img" ).eq( 0 );
|
var el = $( "img" ).eq( 0 );
|
||||||
|
|
||||||
// support: jQuery <1.6.2
|
// support: jQuery <1.6.2
|
||||||
|
@ -150,6 +150,8 @@ test("focusable - not natively focusable with various tabindex", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("focusable - area elements", function() {
|
test("focusable - area elements", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
isFocusable('#areaCoordsHref', 'coords and href');
|
isFocusable('#areaCoordsHref', 'coords and href');
|
||||||
isFocusable('#areaNoCoordsHref', 'href but no coords');
|
isFocusable('#areaNoCoordsHref', 'href but no coords');
|
||||||
isNotFocusable('#areaNoImg', 'not associated with an image');
|
isNotFocusable('#areaNoImg', 'not associated with an image');
|
||||||
@ -227,6 +229,8 @@ test("tabbable - not natively tabbable with various tabindex", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("tabbable - area elements", function() {
|
test("tabbable - area elements", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
isTabbable('#areaCoordsHref', 'coords and href');
|
isTabbable('#areaCoordsHref', 'coords and href');
|
||||||
isTabbable('#areaNoCoordsHref', 'href but no coords');
|
isTabbable('#areaNoCoordsHref', 'href but no coords');
|
||||||
isNotTabbable('#areaNoImg', 'not associated with an image');
|
isNotTabbable('#areaNoImg', 'not associated with an image');
|
||||||
|
@ -43,16 +43,19 @@ var PROP_NAME = 'datepicker';
|
|||||||
module("datepicker: core");
|
module("datepicker: core");
|
||||||
|
|
||||||
test( "widget method - empty collection", function() {
|
test( "widget method - empty collection", function() {
|
||||||
|
expect( 1 );
|
||||||
$( "#nonExist" ).datepicker(); // should create nothing
|
$( "#nonExist" ).datepicker(); // should create nothing
|
||||||
ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" );
|
ok( !$( "#ui-datepicker-div" ).length, "Non init on empty collection" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test("widget method", function() {
|
test("widget method", function() {
|
||||||
|
expect( 1 );
|
||||||
var actual = $("#inp").datepicker().datepicker("widget")[0];
|
var actual = $("#inp").datepicker().datepicker("widget")[0];
|
||||||
deepEqual($("body > #ui-datepicker-div:last-child")[0], actual);
|
deepEqual($("body > #ui-datepicker-div:last-child")[0], actual);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('baseStructure', function() {
|
test('baseStructure', function() {
|
||||||
|
expect( 59 );
|
||||||
var header, title, table, thead, week, panel, inl, child,
|
var header, title, table, thead, week, panel, inl, child,
|
||||||
inp = init('#inp').focus(),
|
inp = init('#inp').focus(),
|
||||||
dp = $('#ui-datepicker-div'),
|
dp = $('#ui-datepicker-div'),
|
||||||
@ -176,6 +179,7 @@ test('baseStructure', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('customStructure', function() {
|
test('customStructure', function() {
|
||||||
|
expect( 20 );
|
||||||
var iframe, header, panel, title, thead,
|
var iframe, header, panel, title, thead,
|
||||||
dp = $('#ui-datepicker-div'),
|
dp = $('#ui-datepicker-div'),
|
||||||
// Check right-to-left localisation
|
// Check right-to-left localisation
|
||||||
@ -233,6 +237,7 @@ test('customStructure', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('keystrokes', function() {
|
test('keystrokes', function() {
|
||||||
|
expect( 26 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
date = new Date();
|
date = new Date();
|
||||||
inp.val('').datepicker('show').
|
inp.val('').datepicker('show').
|
||||||
@ -367,6 +372,7 @@ test('keystrokes', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('mouse', function() {
|
test('mouse', function() {
|
||||||
|
expect( 15 );
|
||||||
var inl,
|
var inl,
|
||||||
inp = init('#inp'),
|
inp = init('#inp'),
|
||||||
dp = $('#ui-datepicker-div'),
|
dp = $('#ui-datepicker-div'),
|
||||||
|
@ -22,6 +22,7 @@ function callback2(year, month, inst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test('events', function() {
|
test('events', function() {
|
||||||
|
expect( 26 );
|
||||||
var dateStr, newMonthYear, inp2,
|
var dateStr, newMonthYear, inp2,
|
||||||
inp = init('#inp', {onSelect: callback}),
|
inp = init('#inp', {onSelect: callback}),
|
||||||
date = new Date();
|
date = new Date();
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
module("datepicker: methods");
|
module("datepicker: methods");
|
||||||
|
|
||||||
test('destroy', function() {
|
test('destroy', function() {
|
||||||
|
expect( 33 );
|
||||||
var inl,
|
var inl,
|
||||||
inp = init('#inp');
|
inp = init('#inp');
|
||||||
ok(inp.is('.hasDatepicker'), 'Default - marker class set');
|
ok(inp.is('.hasDatepicker'), 'Default - marker class set');
|
||||||
@ -63,6 +64,7 @@ test('destroy', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('enableDisable', function() {
|
test('enableDisable', function() {
|
||||||
|
expect( 33 );
|
||||||
var inl, dp,
|
var inl, dp,
|
||||||
inp = init('#inp');
|
inp = init('#inp');
|
||||||
ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled');
|
ok(!inp.datepicker('isDisabled'), 'Enable/disable - initially marked as enabled');
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
module("datepicker: options");
|
module("datepicker: options");
|
||||||
|
|
||||||
test('setDefaults', function() {
|
test('setDefaults', function() {
|
||||||
|
expect( 3 );
|
||||||
var inp = init('#inp');
|
var inp = init('#inp');
|
||||||
equal($.datepicker._defaults.showOn, 'focus', 'Initial showOn');
|
equal($.datepicker._defaults.showOn, 'focus', 'Initial showOn');
|
||||||
$.datepicker.setDefaults({showOn: 'button'});
|
$.datepicker.setDefaults({showOn: 'button'});
|
||||||
@ -16,6 +17,7 @@ test('setDefaults', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('option', function() {
|
test('option', function() {
|
||||||
|
expect( 17 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
inst = $.data(inp[0], PROP_NAME);
|
inst = $.data(inp[0], PROP_NAME);
|
||||||
// Set option
|
// Set option
|
||||||
@ -47,6 +49,7 @@ test('option', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('change', function() {
|
test('change', function() {
|
||||||
|
expect( 12 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
inst = $.data(inp[0], PROP_NAME);
|
inst = $.data(inp[0], PROP_NAME);
|
||||||
equal(inst.settings.showOn, null, 'Initial setting showOn');
|
equal(inst.settings.showOn, null, 'Initial setting showOn');
|
||||||
@ -67,6 +70,7 @@ test('change', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('invocation', function() {
|
test('invocation', function() {
|
||||||
|
expect( 29 );
|
||||||
var button, image,
|
var button, image,
|
||||||
inp = init('#inp'),
|
inp = init('#inp'),
|
||||||
dp = $('#ui-datepicker-div'),
|
dp = $('#ui-datepicker-div'),
|
||||||
@ -138,6 +142,7 @@ test('invocation', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('otherMonths', function() {
|
test('otherMonths', function() {
|
||||||
|
expect( 8 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
pop = $('#ui-datepicker-div');
|
pop = $('#ui-datepicker-div');
|
||||||
inp.val('06/01/2009').datepicker('show');
|
inp.val('06/01/2009').datepicker('show');
|
||||||
@ -159,6 +164,7 @@ test('otherMonths', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('defaultDate', function() {
|
test('defaultDate', function() {
|
||||||
|
expect( 17 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
date = new Date();
|
date = new Date();
|
||||||
inp.val('').datepicker('show').
|
inp.val('').datepicker('show').
|
||||||
@ -253,6 +259,7 @@ test('defaultDate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('miscellaneous', function() {
|
test('miscellaneous', function() {
|
||||||
|
expect( 19 );
|
||||||
var curYear, longNames, shortNames, date,
|
var curYear, longNames, shortNames, date,
|
||||||
dp = $('#ui-datepicker-div'),
|
dp = $('#ui-datepicker-div'),
|
||||||
inp = init('#inp');
|
inp = init('#inp');
|
||||||
@ -314,6 +321,7 @@ test('miscellaneous', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('minMax', function() {
|
test('minMax', function() {
|
||||||
|
expect( 17 );
|
||||||
var date,
|
var date,
|
||||||
inp = init('#inp'),
|
inp = init('#inp'),
|
||||||
lastYear = new Date(2007, 6 - 1, 4),
|
lastYear = new Date(2007, 6 - 1, 4),
|
||||||
@ -398,6 +406,7 @@ test('minMax', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('setDate', function() {
|
test('setDate', function() {
|
||||||
|
expect( 24 );
|
||||||
var inl, alt, minDate, maxDate, dateAndTimeToSet, dateAndTimeClone,
|
var inl, alt, minDate, maxDate, dateAndTimeToSet, dateAndTimeClone,
|
||||||
inp = init('#inp'),
|
inp = init('#inp'),
|
||||||
date1 = new Date(2008, 6 - 1, 4),
|
date1 = new Date(2008, 6 - 1, 4),
|
||||||
@ -477,6 +486,7 @@ test('setDate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('altField', function() {
|
test('altField', function() {
|
||||||
|
expect( 10 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
alt = $('#alt');
|
alt = $('#alt');
|
||||||
// No alternate field set
|
// No alternate field set
|
||||||
@ -515,6 +525,7 @@ test('altField', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('autoSize', function() {
|
test('autoSize', function() {
|
||||||
|
expect( 15 );
|
||||||
var inp = init('#inp');
|
var inp = init('#inp');
|
||||||
equal(inp.prop('size'), 20, 'Auto size - default');
|
equal(inp.prop('size'), 20, 'Auto size - default');
|
||||||
inp.datepicker('option', 'autoSize', true);
|
inp.datepicker('option', 'autoSize', true);
|
||||||
@ -550,6 +561,7 @@ test('autoSize', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('daylightSaving', function() {
|
test('daylightSaving', function() {
|
||||||
|
expect( 25 );
|
||||||
var inp = init('#inp'),
|
var inp = init('#inp'),
|
||||||
dp = $('#ui-datepicker-div');
|
dp = $('#ui-datepicker-div');
|
||||||
ok(true, 'Daylight saving - ' + new Date());
|
ok(true, 'Daylight saving - ' + new Date());
|
||||||
@ -664,6 +676,7 @@ function calcWeek(date) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
test('callbacks', function() {
|
test('callbacks', function() {
|
||||||
|
expect( 13 );
|
||||||
// Before show
|
// Before show
|
||||||
var dp, day20, day21,
|
var dp, day20, day21,
|
||||||
inp = init('#inp', {beforeShow: beforeAll}),
|
inp = init('#inp', {beforeShow: beforeAll}),
|
||||||
@ -693,6 +706,7 @@ test('callbacks', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('localisation', function() {
|
test('localisation', function() {
|
||||||
|
expect( 24 );
|
||||||
var dp, month, day, date,
|
var dp, month, day, date,
|
||||||
inp = init('#inp', $.datepicker.regional.fr);
|
inp = 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');
|
||||||
@ -722,6 +736,7 @@ test('localisation', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('noWeekends', function() {
|
test('noWeekends', function() {
|
||||||
|
expect( 31 );
|
||||||
var i, date;
|
var i, date;
|
||||||
for (i = 1; i <= 31; i++) {
|
for (i = 1; i <= 31; i++) {
|
||||||
date = new Date(2001, 1 - 1, i);
|
date = new Date(2001, 1 - 1, i);
|
||||||
@ -731,6 +746,7 @@ test('noWeekends', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('iso8601Week', function() {
|
test('iso8601Week', function() {
|
||||||
|
expect( 12 );
|
||||||
var date = new Date(2000, 12 - 1, 31);
|
var date = new Date(2000, 12 - 1, 31);
|
||||||
equal($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
|
equal($.datepicker.iso8601Week(date), 52, 'ISO 8601 week ' + date);
|
||||||
date = new Date(2001, 1 - 1, 1);
|
date = new Date(2001, 1 - 1, 1);
|
||||||
@ -758,6 +774,7 @@ test('iso8601Week', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('parseDate', function() {
|
test('parseDate', function() {
|
||||||
|
expect( 26 );
|
||||||
init('#inp');
|
init('#inp');
|
||||||
var currentYear, gmtDate, fr, settings, zh;
|
var currentYear, gmtDate, fr, settings, zh;
|
||||||
ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty');
|
ok($.datepicker.parseDate('d m y', '') == null, 'Parse date empty');
|
||||||
@ -822,6 +839,7 @@ test('parseDate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('parseDateErrors', function() {
|
test('parseDateErrors', function() {
|
||||||
|
expect( 17 );
|
||||||
init('#inp');
|
init('#inp');
|
||||||
var fr, settings;
|
var fr, settings;
|
||||||
function expectError(expr, value, error) {
|
function expectError(expr, value, error) {
|
||||||
@ -874,6 +892,7 @@ test('parseDateErrors', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('formatDate', function() {
|
test('formatDate', function() {
|
||||||
|
expect( 16 );
|
||||||
init('#inp');
|
init('#inp');
|
||||||
var gmtDate, fr, settings;
|
var gmtDate, fr, settings;
|
||||||
equal($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)),
|
equal($.datepicker.formatDate('d m y', new Date(2001, 2 - 1, 3)),
|
||||||
|
@ -7,6 +7,7 @@ module("datepicker: tickets");
|
|||||||
|
|
||||||
// http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1
|
// http://forum.jquery.com/topic/several-breaking-changes-in-jquery-ui-1-8rc1
|
||||||
test('beforeShowDay-getDate', function() {
|
test('beforeShowDay-getDate', function() {
|
||||||
|
expect( 3 );
|
||||||
var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }}),
|
var inp = init('#inp', {beforeShowDay: function(date) { inp.datepicker('getDate'); return [true, '']; }}),
|
||||||
dp = $('#ui-datepicker-div');
|
dp = $('#ui-datepicker-div');
|
||||||
inp.val('01/01/2010').datepicker('show');
|
inp.val('01/01/2010').datepicker('show');
|
||||||
@ -25,6 +26,7 @@ test('beforeShowDay-getDate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
|
test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler', function(){
|
||||||
|
expect( 3 );
|
||||||
var inp = init('#inp',{
|
var inp = init('#inp',{
|
||||||
beforeShow: function(){
|
beforeShow: function(){
|
||||||
return false;
|
return false;
|
||||||
@ -58,11 +60,13 @@ test('Ticket 7602: Stop datepicker from appearing with beforeShow event handler'
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
|
test('Ticket 6827: formatDate day of year calculation is wrong during day lights savings time', function(){
|
||||||
|
expect( 1 );
|
||||||
var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
|
var time = $.datepicker.formatDate("oo", new Date("2010/03/30 12:00:00 CDT"));
|
||||||
equal(time, "089");
|
equal(time, "089");
|
||||||
});
|
});
|
||||||
|
|
||||||
test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
|
test('Ticket #7244: date parser does not fail when too many numbers are passed into the date function', function() {
|
||||||
|
expect( 4 );
|
||||||
var date;
|
var date;
|
||||||
try{
|
try{
|
||||||
date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
|
date = $.datepicker.parseDate('dd/mm/yy', '18/04/19881');
|
||||||
|
@ -116,6 +116,7 @@ test("ARIA", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("widget method", function() {
|
test("widget method", function() {
|
||||||
|
expect( 1 );
|
||||||
var dialog = $("<div>").appendTo("#main").dialog();
|
var dialog = $("<div>").appendTo("#main").dialog();
|
||||||
deepEqual(dialog.parent()[0], dialog.dialog("widget")[0]);
|
deepEqual(dialog.parent()[0], dialog.dialog("widget")[0]);
|
||||||
});
|
});
|
||||||
|
@ -34,6 +34,8 @@ test("init", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("destroy", function() {
|
test("destroy", function() {
|
||||||
|
expect( 4 );
|
||||||
|
|
||||||
$("<div></div>").appendTo('body').dialog().dialog("destroy").remove();
|
$("<div></div>").appendTo('body').dialog().dialog("destroy").remove();
|
||||||
ok(true, '.dialog("destroy") called on element');
|
ok(true, '.dialog("destroy") called on element');
|
||||||
|
|
||||||
@ -49,6 +51,8 @@ test("destroy", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("enable", function() {
|
test("enable", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
var expected = $('<div></div>').dialog(),
|
var expected = $('<div></div>').dialog(),
|
||||||
actual = expected.dialog('enable');
|
actual = expected.dialog('enable');
|
||||||
equal(actual, expected, 'enable is chainable');
|
equal(actual, expected, 'enable is chainable');
|
||||||
@ -60,6 +64,8 @@ test("enable", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("disable", function() {
|
test("disable", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
var expected = $('<div></div>').dialog(),
|
var expected = $('<div></div>').dialog(),
|
||||||
actual = expected.dialog('disable');
|
actual = expected.dialog('disable');
|
||||||
equal(actual, expected, 'disable is chainable');
|
equal(actual, expected, 'disable is chainable');
|
||||||
@ -71,6 +77,8 @@ test("disable", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("close", function() {
|
test("close", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
var expected = $('<div></div>').dialog(),
|
var expected = $('<div></div>').dialog(),
|
||||||
actual = expected.dialog('close');
|
actual = expected.dialog('close');
|
||||||
equal(actual, expected, 'close is chainable');
|
equal(actual, expected, 'close is chainable');
|
||||||
@ -98,6 +106,8 @@ test("isOpen", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("moveToTop", function() {
|
test("moveToTop", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
var d1, d2, dlg1, dlg2,
|
var d1, d2, dlg1, dlg2,
|
||||||
expected = $('<div></div>').dialog(),
|
expected = $('<div></div>').dialog(),
|
||||||
actual = expected.dialog('moveToTop');
|
actual = expected.dialog('moveToTop');
|
||||||
@ -117,6 +127,7 @@ test("moveToTop", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("open", function() {
|
test("open", function() {
|
||||||
|
expect( 3 );
|
||||||
var expected = $('<div></div>').dialog(),
|
var expected = $('<div></div>').dialog(),
|
||||||
actual = expected.dialog('open');
|
actual = expected.dialog('open');
|
||||||
equal(actual, expected, 'open is chainable');
|
equal(actual, expected, 'open is chainable');
|
||||||
|
@ -106,6 +106,7 @@ test("buttons - advanced", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("closeOnEscape", function() {
|
test("closeOnEscape", function() {
|
||||||
|
expect( 6 );
|
||||||
el = $('<div></div>').dialog({ closeOnEscape: false });
|
el = $('<div></div>').dialog({ closeOnEscape: false });
|
||||||
ok(true, 'closeOnEscape: false');
|
ok(true, 'closeOnEscape: false');
|
||||||
ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC');
|
ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC');
|
||||||
@ -276,6 +277,7 @@ test("minWidth", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, default center on window", function() {
|
test("position, default center on window", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog(),
|
var el = $('<div></div>').dialog(),
|
||||||
dialog = el.dialog('widget'),
|
dialog = el.dialog('widget'),
|
||||||
offset = dialog.offset();
|
offset = dialog.offset();
|
||||||
@ -285,6 +287,7 @@ test("position, default center on window", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, top on window", function() {
|
test("position, top on window", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog({ position: "top" }),
|
var el = $('<div></div>').dialog({ position: "top" }),
|
||||||
dialog = el.dialog('widget'),
|
dialog = el.dialog('widget'),
|
||||||
offset = dialog.offset();
|
offset = dialog.offset();
|
||||||
@ -294,6 +297,7 @@ test("position, top on window", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, left on window", function() {
|
test("position, left on window", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog({ position: "left" }),
|
var el = $('<div></div>').dialog({ position: "left" }),
|
||||||
dialog = el.dialog('widget'),
|
dialog = el.dialog('widget'),
|
||||||
offset = dialog.offset();
|
offset = dialog.offset();
|
||||||
@ -303,6 +307,7 @@ test("position, left on window", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, right bottom on window", function() {
|
test("position, right bottom on window", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog({ position: "right bottom" }),
|
var el = $('<div></div>').dialog({ position: "right bottom" }),
|
||||||
dialog = el.dialog('widget'),
|
dialog = el.dialog('widget'),
|
||||||
offset = dialog.offset();
|
offset = dialog.offset();
|
||||||
@ -312,6 +317,7 @@ test("position, right bottom on window", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, right bottom on window w/array", function() {
|
test("position, right bottom on window w/array", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog({ position: ["right", "bottom"] }),
|
var el = $('<div></div>').dialog({ position: ["right", "bottom"] }),
|
||||||
dialog = el.dialog('widget'),
|
dialog = el.dialog('widget'),
|
||||||
offset = dialog.offset();
|
offset = dialog.offset();
|
||||||
@ -321,6 +327,7 @@ test("position, right bottom on window w/array", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, offset from top left w/array", function() {
|
test("position, offset from top left w/array", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog({ position: [10, 10] }),
|
var el = $('<div></div>').dialog({ position: [10, 10] }),
|
||||||
dialog = el.dialog('widget'),
|
dialog = el.dialog('widget'),
|
||||||
offset = dialog.offset();
|
offset = dialog.offset();
|
||||||
@ -330,6 +337,7 @@ test("position, offset from top left w/array", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, right bottom at right bottom via ui.position args", function() {
|
test("position, right bottom at right bottom via ui.position args", function() {
|
||||||
|
expect( 2 );
|
||||||
var el = $('<div></div>').dialog({
|
var el = $('<div></div>').dialog({
|
||||||
position: {
|
position: {
|
||||||
my: "right bottom",
|
my: "right bottom",
|
||||||
@ -345,6 +353,7 @@ test("position, right bottom at right bottom via ui.position args", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("position, at another element", function() {
|
test("position, at another element", function() {
|
||||||
|
expect( 4 );
|
||||||
var parent = $('<div></div>').css({
|
var parent = $('<div></div>').css({
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: 400,
|
top: 400,
|
||||||
|
@ -71,6 +71,7 @@ test("#5184: isOpen in dialogclose event is true", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("#5531: dialog width should be at least minWidth on creation", function () {
|
test("#5531: dialog width should be at least minWidth on creation", function () {
|
||||||
|
expect( 4 );
|
||||||
el = $('<div></div>').dialog({
|
el = $('<div></div>').dialog({
|
||||||
width: 200,
|
width: 200,
|
||||||
minWidth: 300
|
minWidth: 300
|
||||||
@ -192,6 +193,7 @@ test("#6966: Escape key closes all dialogs, not the top one", function(){
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("#4980: Destroy should place element back in original DOM position", function(){
|
test("#4980: Destroy should place element back in original DOM position", function(){
|
||||||
|
expect( 2 );
|
||||||
container = $('<div id="container"><div id="modal">Content</div></div>');
|
container = $('<div id="container"><div id="modal">Content</div></div>');
|
||||||
modal = container.find('#modal');
|
modal = container.find('#modal');
|
||||||
modal.dialog();
|
modal.dialog();
|
||||||
|
@ -153,6 +153,7 @@ asyncTest( "animateClass clears style properties when stopped", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
asyncTest( "animateClass: css and class changes during animation are not lost (#7106)", function() {
|
asyncTest( "animateClass: css and class changes during animation are not lost (#7106)", function() {
|
||||||
|
expect( 2 );
|
||||||
var test = $( "div.ticket7106" );
|
var test = $( "div.ticket7106" );
|
||||||
|
|
||||||
// ensure the class stays and that the css property stays
|
// ensure the class stays and that the css property stays
|
||||||
|
@ -4,6 +4,7 @@ module( "effect.scale: Scale" );
|
|||||||
function run( position, v, h, vo, ho ) {
|
function run( position, v, h, vo, ho ) {
|
||||||
var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")";
|
var desc = "End Position Correct: " + position + " (" + v + "," + h + ") - origin: (" + vo + "," + ho + ")";
|
||||||
asyncTest( desc, function() {
|
asyncTest( desc, function() {
|
||||||
|
expect( 2 );
|
||||||
function complete() {
|
function complete() {
|
||||||
equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc );
|
equal( parseInt( test.css( h ), 10 ), target[ h ], "Horizontal Position Correct " + desc );
|
||||||
equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc );
|
equal( parseInt( test.css( v ), 10 ), target[ v ], "Vertical Position Correct " + desc );
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
(function( $ ) {
|
(function( $ ) {
|
||||||
|
|
||||||
test( "offset", function() {
|
test( "offset", function() {
|
||||||
|
expect( 3 );
|
||||||
$( "#elx" ).position({
|
$( "#elx" ).position({
|
||||||
my: "left top",
|
my: "left top",
|
||||||
at: "left bottom",
|
at: "left bottom",
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
module( "progressbar: options" );
|
module( "progressbar: options" );
|
||||||
|
|
||||||
test( "{ value : 0 }, default", function() {
|
test( "{ value : 0 }, default", function() {
|
||||||
|
expect( 1 );
|
||||||
$( "#progressbar" ).progressbar();
|
$( "#progressbar" ).progressbar();
|
||||||
equal( 0, $( "#progressbar" ).progressbar( "value" ) );
|
equal( 0, $( "#progressbar" ).progressbar( "value" ) );
|
||||||
});
|
});
|
||||||
@ -28,6 +29,7 @@ test( "value: visibility of valueDiv", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "{ value : 5 }", function() {
|
test( "{ value : 5 }", function() {
|
||||||
|
expect( 1 );
|
||||||
$( "#progressbar" ).progressbar({
|
$( "#progressbar" ).progressbar({
|
||||||
value: 5
|
value: 5
|
||||||
});
|
});
|
||||||
@ -35,6 +37,7 @@ test( "{ value : 5 }", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "{ value : -5 }", function() {
|
test( "{ value : -5 }", function() {
|
||||||
|
expect( 1 );
|
||||||
$( "#progressbar" ).progressbar({
|
$( "#progressbar" ).progressbar({
|
||||||
value: -5
|
value: -5
|
||||||
});
|
});
|
||||||
@ -42,6 +45,7 @@ test( "{ value : -5 }", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "{ value : 105 }", function() {
|
test( "{ value : 105 }", function() {
|
||||||
|
expect( 1 );
|
||||||
$( "#progressbar" ).progressbar({
|
$( "#progressbar" ).progressbar({
|
||||||
value: 105
|
value: 105
|
||||||
});
|
});
|
||||||
@ -49,6 +53,7 @@ test( "{ value : 105 }", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "{ max : 5, value : 10 }", function() {
|
test( "{ max : 5, value : 10 }", function() {
|
||||||
|
expect( 1 );
|
||||||
$("#progressbar").progressbar({
|
$("#progressbar").progressbar({
|
||||||
max: 5,
|
max: 5,
|
||||||
value: 10
|
value: 10
|
||||||
|
@ -6,6 +6,7 @@ var disabled = TestHelpers.tabs.disabled,
|
|||||||
module( "tabs: methods" );
|
module( "tabs: methods" );
|
||||||
|
|
||||||
test( "destroy", function() {
|
test( "destroy", function() {
|
||||||
|
expect( 1 );
|
||||||
domEqual( "#tabs1", function() {
|
domEqual( "#tabs1", function() {
|
||||||
$( "#tabs1" ).tabs().tabs( "destroy" );
|
$( "#tabs1" ).tabs().tabs( "destroy" );
|
||||||
});
|
});
|
||||||
|
@ -69,6 +69,8 @@ test( "{ active: Number }", function() {
|
|||||||
|
|
||||||
if ( $.uiBackCompat === false ) {
|
if ( $.uiBackCompat === false ) {
|
||||||
test( "{ active: -Number }", function() {
|
test( "{ active: -Number }", function() {
|
||||||
|
expect( 8 );
|
||||||
|
|
||||||
var element = $( "#tabs1" ).tabs({
|
var element = $( "#tabs1" ).tabs({
|
||||||
active: -1
|
active: -1
|
||||||
});
|
});
|
||||||
|
@ -10,6 +10,8 @@ function includeScript( url ) {
|
|||||||
document.write( "<script src='../../../" + url + "'></script>" );
|
document.write( "<script src='../../../" + url + "'></script>" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QUnit.config.requireExpects = true;
|
||||||
|
|
||||||
QUnit.config.urlConfig.push( "min" );
|
QUnit.config.urlConfig.push( "min" );
|
||||||
TestHelpers.loadResources = QUnit.urlParams.min ?
|
TestHelpers.loadResources = QUnit.urlParams.min ?
|
||||||
function() {
|
function() {
|
||||||
@ -76,7 +78,9 @@ function testWidgetDefaults( widget, defaults ) {
|
|||||||
|
|
||||||
// ensure that all defaults have the correct value
|
// ensure that all defaults have the correct value
|
||||||
test( "defined defaults", function() {
|
test( "defined defaults", function() {
|
||||||
|
var count = 0;
|
||||||
$.each( defaults, function( key, val ) {
|
$.each( defaults, function( key, val ) {
|
||||||
|
expect( ++count );
|
||||||
if ( $.isFunction( val ) ) {
|
if ( $.isFunction( val ) ) {
|
||||||
ok( $.isFunction( pluginDefaults[ key ] ), key );
|
ok( $.isFunction( pluginDefaults[ key ] ), key );
|
||||||
return;
|
return;
|
||||||
@ -87,7 +91,9 @@ function testWidgetDefaults( widget, defaults ) {
|
|||||||
|
|
||||||
// ensure that all defaults were tested
|
// ensure that all defaults were tested
|
||||||
test( "tested defaults", function() {
|
test( "tested defaults", function() {
|
||||||
|
var count = 0;
|
||||||
$.each( pluginDefaults, function( key, val ) {
|
$.each( pluginDefaults, function( key, val ) {
|
||||||
|
expect( ++count );
|
||||||
ok( key in defaults, key );
|
ok( key in defaults, key );
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -96,6 +102,7 @@ function testWidgetDefaults( widget, defaults ) {
|
|||||||
function testWidgetOverrides( widget ) {
|
function testWidgetOverrides( widget ) {
|
||||||
if ( $.uiBackCompat === false ) {
|
if ( $.uiBackCompat === false ) {
|
||||||
test( "$.widget overrides", function() {
|
test( "$.widget overrides", function() {
|
||||||
|
expect( 4 );
|
||||||
$.each([
|
$.each([
|
||||||
"_createWidget",
|
"_createWidget",
|
||||||
"destroy",
|
"destroy",
|
||||||
@ -111,6 +118,8 @@ function testWidgetOverrides( widget ) {
|
|||||||
|
|
||||||
function testBasicUsage( widget ) {
|
function testBasicUsage( widget ) {
|
||||||
test( "basic usage", function() {
|
test( "basic usage", function() {
|
||||||
|
expect( 3 );
|
||||||
|
|
||||||
var defaultElement = $.ui[ widget ].prototype.defaultElement;
|
var defaultElement = $.ui[ widget ].prototype.defaultElement;
|
||||||
$( defaultElement ).appendTo( "body" )[ widget ]().remove();
|
$( defaultElement ).appendTo( "body" )[ widget ]().remove();
|
||||||
ok( true, "initialized on element" );
|
ok( true, "initialized on element" );
|
||||||
@ -131,6 +140,7 @@ TestHelpers.commonWidgetTests = function( widget, settings ) {
|
|||||||
testWidgetOverrides( widget );
|
testWidgetOverrides( widget );
|
||||||
testBasicUsage( widget );
|
testBasicUsage( widget );
|
||||||
test( "version", function() {
|
test( "version", function() {
|
||||||
|
expect( 1 );
|
||||||
ok( "version" in $.ui[ widget ].prototype, "version property exists" );
|
ok( "version" in $.ui[ widget ].prototype, "version property exists" );
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -3,11 +3,13 @@
|
|||||||
module( "tooltip: options" );
|
module( "tooltip: options" );
|
||||||
|
|
||||||
test( "content: default", function() {
|
test( "content: default", function() {
|
||||||
|
expect( 1 );
|
||||||
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
|
var element = $( "#tooltipped1" ).tooltip().tooltip( "open" );
|
||||||
deepEqual( $( "#" + element.data( "ui-tooltip-id" ) ).text(), "anchortitle" );
|
deepEqual( $( "#" + element.data( "ui-tooltip-id" ) ).text(), "anchortitle" );
|
||||||
});
|
});
|
||||||
|
|
||||||
test( "content: return string", function() {
|
test( "content: return string", function() {
|
||||||
|
expect( 1 );
|
||||||
var element = $( "#tooltipped1" ).tooltip({
|
var element = $( "#tooltipped1" ).tooltip({
|
||||||
content: function() {
|
content: function() {
|
||||||
return "customstring";
|
return "customstring";
|
||||||
@ -17,6 +19,7 @@ test( "content: return string", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "content: return jQuery", function() {
|
test( "content: return jQuery", function() {
|
||||||
|
expect( 1 );
|
||||||
var element = $( "#tooltipped1" ).tooltip({
|
var element = $( "#tooltipped1" ).tooltip({
|
||||||
content: function() {
|
content: function() {
|
||||||
return $( "<div>" ).html( "cu<b>s</b>tomstring" );
|
return $( "<div>" ).html( "cu<b>s</b>tomstring" );
|
||||||
|
@ -11,6 +11,7 @@ module( "widget factory", {
|
|||||||
TestHelpers.testJshint( "widget" );
|
TestHelpers.testJshint( "widget" );
|
||||||
|
|
||||||
test( "widget creation", function() {
|
test( "widget creation", function() {
|
||||||
|
expect( 5 );
|
||||||
var myPrototype = {
|
var myPrototype = {
|
||||||
_create: function() {},
|
_create: function() {},
|
||||||
creationTest: function() {}
|
creationTest: function() {}
|
||||||
@ -78,6 +79,7 @@ test( "element normalization", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "custom selector expression", function() {
|
test( "custom selector expression", function() {
|
||||||
|
expect( 1 );
|
||||||
var elem = $( "<div>" ).appendTo( "#qunit-fixture" );
|
var elem = $( "<div>" ).appendTo( "#qunit-fixture" );
|
||||||
$.widget( "ui.testWidget", {} );
|
$.widget( "ui.testWidget", {} );
|
||||||
elem.testWidget();
|
elem.testWidget();
|
||||||
@ -300,6 +302,7 @@ test( "._getCreateEventData()", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "re-init", function() {
|
test( "re-init", function() {
|
||||||
|
expect( 3 );
|
||||||
var div = $( "<div>" ),
|
var div = $( "<div>" ),
|
||||||
actions = [];
|
actions = [];
|
||||||
|
|
||||||
@ -329,6 +332,7 @@ test( "re-init", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "inheritance - options", function() {
|
test( "inheritance - options", function() {
|
||||||
|
expect( 4 );
|
||||||
// #5830 - Widget: Using inheritance overwrites the base classes options
|
// #5830 - Widget: Using inheritance overwrites the base classes options
|
||||||
$.widget( "ui.testWidgetBase", {
|
$.widget( "ui.testWidgetBase", {
|
||||||
options: {
|
options: {
|
||||||
@ -441,6 +445,7 @@ test( "._superApply()", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".option() - getter", function() {
|
test( ".option() - getter", function() {
|
||||||
|
expect( 6 );
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
_create: function() {}
|
_create: function() {}
|
||||||
});
|
});
|
||||||
@ -472,6 +477,7 @@ test( ".option() - getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".option() - deep option getter", function() {
|
test( ".option() - deep option getter", function() {
|
||||||
|
expect( 5 );
|
||||||
$.widget( "ui.testWidget", {} );
|
$.widget( "ui.testWidget", {} );
|
||||||
var div = $( "<div>" ).testWidget({
|
var div = $( "<div>" ).testWidget({
|
||||||
foo: {
|
foo: {
|
||||||
@ -490,6 +496,7 @@ test( ".option() - deep option getter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".option() - delegate to ._setOptions()", function() {
|
test( ".option() - delegate to ._setOptions()", function() {
|
||||||
|
expect( 2 );
|
||||||
var div,
|
var div,
|
||||||
calls = [];
|
calls = [];
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
@ -514,6 +521,7 @@ test( ".option() - delegate to ._setOptions()", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".option() - delegate to ._setOption()", function() {
|
test( ".option() - delegate to ._setOption()", function() {
|
||||||
|
expect( 2 );
|
||||||
var div,
|
var div,
|
||||||
calls = [];
|
calls = [];
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
@ -544,6 +552,7 @@ test( ".option() - delegate to ._setOption()", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".option() - deep option setter", function() {
|
test( ".option() - deep option setter", function() {
|
||||||
|
expect( 6 );
|
||||||
$.widget( "ui.testWidget", {} );
|
$.widget( "ui.testWidget", {} );
|
||||||
var div = $( "<div>" ).testWidget();
|
var div = $( "<div>" ).testWidget();
|
||||||
function deepOption( from, to, msg ) {
|
function deepOption( from, to, msg ) {
|
||||||
@ -592,6 +601,7 @@ test( ".disable()", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".widget() - base", function() {
|
test( ".widget() - base", function() {
|
||||||
|
expect( 1 );
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
_create: function() {}
|
_create: function() {}
|
||||||
});
|
});
|
||||||
@ -600,6 +610,7 @@ test( ".widget() - base", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( ".widget() - overriden", function() {
|
test( ".widget() - overriden", function() {
|
||||||
|
expect( 1 );
|
||||||
var wrapper = $( "<div>" );
|
var wrapper = $( "<div>" );
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
_create: function() {},
|
_create: function() {},
|
||||||
@ -845,6 +856,7 @@ test( "_off() - all events", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "._hoverable()", function() {
|
test( "._hoverable()", function() {
|
||||||
|
expect( 10 );
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
_create: function() {
|
_create: function() {
|
||||||
this._hoverable( this.element.children() );
|
this._hoverable( this.element.children() );
|
||||||
@ -876,6 +888,7 @@ test( "._hoverable()", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "._focusable()", function() {
|
test( "._focusable()", function() {
|
||||||
|
expect( 10 );
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
_create: function() {
|
_create: function() {
|
||||||
this._focusable( this.element.children() );
|
this._focusable( this.element.children() );
|
||||||
@ -959,6 +972,7 @@ test( "._trigger() - cancelled event", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test( "._trigger() - cancelled callback", function() {
|
test( "._trigger() - cancelled callback", function() {
|
||||||
|
expect( 1 );
|
||||||
$.widget( "ui.testWidget", {
|
$.widget( "ui.testWidget", {
|
||||||
_create: function() {}
|
_create: function() {}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user