}
} );
-test( "base structure", function() {
- expect( 28 );
+test( "base structure", function( assert ) {
+ assert.expect( 28 );
var that = this,
buttons, header, title, table, thead, week, child, buttonpane;
step1();
} );
-test( "Localization", function() {
- expect( 10 );
+test( "Localization", function( assert ) {
+ assert.expect( 10 );
var that = this,
date = new Date( 2014, 0, 1 ),
} );
asyncTest( "keyboard handling", function( assert ) {
- expect( 10 );
+ assert.expect( 10 );
var that = this;
} );
asyncTest( "mouse", function( assert ) {
- expect( 6 );
+ assert.expect( 6 );
var that = this,
date = new Date();
}
} );
-test( "change", function() {
- expect( 6 );
+test( "change", function( assert ) {
+ assert.expect( 6 );
var shouldFire, eventType;
this.element.find( "tbody button" ).first().simulate( eventType );
} );
-asyncTest( "select", function() {
- expect( 6 );
+asyncTest( "select", function( assert ) {
+ assert.expect( 6 );
var that = this,
message, eventType;
} );
test( "destroy", function( assert ) {
- expect( 1 );
+ assert.expect( 1 );
var div = $( "<div>" ).appendTo( "#qunit-fixture" );
} );
} );
-test( "enable / disable", function() {
- expect( 8 );
+test( "enable / disable", function( assert ) {
+ assert.expect( 8 );
this.element.calendar( "disable" );
ok( this.element.calendar( "option", "disabled" ), "disabled option is set" );
equal( this.element.attr( "aria-disabled" ), "false", "no longer has ARIA disabled" );
} );
-test( "widget", function() {
- expect( 1 );
+test( "widget", function( assert ) {
+ assert.expect( 1 );
strictEqual( this.widget[ 0 ], this.element[ 0 ] );
} );
-test( "value", function() {
- expect( 3 );
+test( "value", function( assert ) {
+ assert.expect( 3 );
this.element.calendar( "value", "1/1/14" );
ok( this.element.find( "button[data-timestamp]:first" )
} );
test( "valueAsDate", function( assert ) {
- expect( 11 );
+ assert.expect( 11 );
var minDate, maxDate, dateAndTimeToSet, dateAndTimeClone,
date1 = new Date( 2008, 6 - 1, 4 ),
}
} );
-test( "buttons", function() {
- expect( 21 );
+test( "buttons", function( assert ) {
+ assert.expect( 21 );
var button, i, newButtons,
that = this,
equal( this.element.hasClass( "ui-calendar-buttons" ), false, "calendar element removes class about having buttons" );
} );
-test( "buttons - advanced", function() {
- expect( 7 );
+test( "buttons - advanced", function( assert ) {
+ assert.expect( 7 );
var that = this,
buttons;
buttons.click();
} );
-test( "dateFormat", function() {
- expect( 2 );
+test( "dateFormat", function( assert ) {
+ assert.expect( 2 );
this.element.calendar( "value", "1/1/14" );
equal( this.element.calendar( "value" ), "Wednesday, January 1, 2014", "updated formatting" );
} );
-test( "eachDay", function() {
- expect( 5 );
+test( "eachDay", function( assert ) {
+ assert.expect( 5 );
var timestamp,
firstCell = this.widget.find( "td[id]:first" );
} );
test( "min / max", function( assert ) {
- expect( 17 );
+ assert.expect( 17 );
// With existing date
var prevButton = this.widget.find( ".ui-calendar-prev" ),
ok( !prevButton.hasClass( "ui-state-disabled" ), "Other year below min: Prev button enabled after click" );
} );
-test( "numberOfMonths", function() {
- expect( 6 );
+test( "numberOfMonths", function( assert ) {
+ assert.expect( 6 );
var date = new Date( 2015, 8 - 1, 1 );
} );
test( "value", function( assert ) {
- expect( 4 );
+ assert.expect( 4 );
var date = new Date( 2016, 5 - 1, 23 );
}
} );
-test( "input's value determines starting date", function() {
- expect( 3 );
+test( "input's value determines starting date", function( assert ) {
+ assert.expect( 3 );
this.element = $( "<input>" ).appendTo( "#qunit-fixture" );
this.element.val( "1/1/14" ).datepicker();
equal( this.widget.find( ".ui-state-active" ).html(), "1", "correct day highlighted" );
} );
-asyncTest( "base structure", function() {
- expect( 5 );
+asyncTest( "base structure", function( assert ) {
+ assert.expect( 5 );
var that = this;
}, 50 );
} );
-asyncTest( "Keyboard handling: focus", function() {
- expect( 2 );
+asyncTest( "Keyboard handling: focus", function( assert ) {
+ assert.expect( 2 );
var that = this;
}, 100 );
} );
-asyncTest( "Keyboard handling: keystroke up", function() {
- expect( 2 );
+asyncTest( "Keyboard handling: keystroke up", function( assert ) {
+ assert.expect( 2 );
var that = this;
} );
test( "Keyboard handling: input", function( assert ) {
- expect( 6 );
+ assert.expect( 6 );
var that = this,
instance = that.element.datepicker( "instance" );
} );
asyncTest( "mouse", function( assert ) {
- expect( 4 );
+ assert.expect( 4 );
var that = this;
}
} );
-test( "beforeOpen", function() {
- expect( 3 );
+test( "beforeOpen", function( assert ) {
+ assert.expect( 3 );
var that = this;
.datepicker( "open" );
} );
-test( "change", function() {
- expect( 4 );
+test( "change", function( assert ) {
+ assert.expect( 4 );
var shouldFire;
this.widget.find( "tbody button" ).eq( 2 ).simulate( "mousedown" );
} );
-test( "close", function() {
- expect( 4 );
+test( "close", function( assert ) {
+ assert.expect( 4 );
var shouldFire;
this.widget.find( "tbody tr:first button:first" ).simulate( "mousedown" );
} );
-test( "open", function() {
- expect( 2 );
+test( "open", function( assert ) {
+ assert.expect( 2 );
var that = this;
this.element.datepicker( "open" );
} );
-asyncTest( "select", function() {
- expect( 4 );
+asyncTest( "select", function( assert ) {
+ assert.expect( 4 );
var message = "",
that = this;
} );
test( "destroy", function( assert ) {
- expect( 3 );
+ assert.expect( 3 );
var input = $( "<input>" ).appendTo( "#qunit-fixture" );
} );
} );
-test( "enable / disable", function() {
- expect( 10 );
+test( "enable / disable", function( assert ) {
+ assert.expect( 10 );
this.element.datepicker( "disable" );
ok( this.element.datepicker( "option", "disabled" ), "disabled option is set" );
equal( this.element.attr( "disabled" ), undefined, "input no longer disabled" );
} );
-test( "widget", function() {
- expect( 1 );
+test( "widget", function( assert ) {
+ assert.expect( 1 );
deepEqual( $( "body > .ui-front" )[ 0 ], this.widget[ 0 ] );
this.widget.remove();
} );
-test( "open / close", function() {
- expect( 7 );
+test( "open / close", function( assert ) {
+ assert.expect( 7 );
ok( this.widget.is( ":hidden" ), "calendar hidden on init" );
equal( this.widget.attr( "aria-expanded" ), "false", "close: calendar aria-expanded" );
} );
-test( "value", function() {
- expect( 4 );
+test( "value", function( assert ) {
+ assert.expect( 4 );
this.element.datepicker( "value", "1/1/14" );
equal( this.element.val(), "1/1/14", "input's value set" );
} );
test( "valueAsDate", function( assert ) {
- expect( 5 );
+ assert.expect( 5 );
strictEqual( this.element.datepicker( "valueAsDate" ), null, "Default" );
equal( this.element.datepicker( "valueAsDate" ), null, "Invalid dates return null" );
} );
-test( "isValid", function() {
- expect( 2 );
+test( "isValid", function( assert ) {
+ assert.expect( 2 );
this.element.val( "1/1/14" );
ok( this.element.datepicker( "isValid" ) );
}
} );
-test( "appendTo", function() {
- expect( 6 );
+test( "appendTo", function( assert ) {
+ assert.expect( 6 );
var container = this.widget.parent()[ 0 ],
detached = $( "<div>" );
} );
test( "min / max", function( assert ) {
- expect( 10 );
+ assert.expect( 10 );
var min, max;
} );
-test( "Pass-through options", function() {
- expect( 11 );
+test( "Pass-through options", function( assert ) {
+ assert.expect( 11 );
var options = {
buttons: { "Test": $.noop },
} );
asyncTest( "position", function( assert ) {
- expect( 3 );
+ assert.expect( 3 );
var input = $( "<input>" ).datepicker().appendTo( "body" ).css( {
position: "absolute",
} );
} );
-test( "Stop datepicker from appearing with beforeOpen event handler - nothing", function() {
- expect( 1 );
+test( "Stop datepicker from appearing with beforeOpen event handler - nothing", function( assert ) {
+ assert.expect( 1 );
this.element.datepicker( {
beforeOpen: function() {}
ok( this.element.datepicker( "widget" ).is( ":visible" ), "beforeOpen returns nothing" );
} );
-test( "Stop datepicker from appearing with beforeOpen event handler - true", function() {
- expect( 1 );
+test( "Stop datepicker from appearing with beforeOpen event handler - true", function( assert ) {
+ assert.expect( 1 );
this.element.datepicker( {
beforeOpen: function() {
ok( this.element.datepicker( "widget" ).is( ":visible" ), "beforeOpen returns true" );
} );
-test( "Stop datepicker from appearing with beforeOpen event handler - false", function() {
- expect( 1 );
+test( "Stop datepicker from appearing with beforeOpen event handler - false", function( assert ) {
+ assert.expect( 1 );
this.element.datepicker( {
beforeOpen: function() {