Skip to content

Commit 877937e

Browse files
committed
Calendar tests: Add basic value option tests
1 parent 18ad526 commit 877937e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/unit/calendar/options.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,21 @@ test( "numberOfMonths", function() {
310310
);
311311
} );
312312

313+
test( "value", function( assert ) {
314+
expect( 4 );
315+
316+
var date = new Date( 2016, 5 - 1, 23 );
317+
318+
assert.equal( this.element.calendar( "option", "value" ), null, "Initial value" );
319+
320+
this.element.calendar( "option", "value", date );
321+
assert.dateEqual( this.element.calendar( "option", "value" ), date, "Value set" );
322+
equal( this.widget.find( "table button.ui-state-active" ).data( "timestamp" ), 1463954400000, "Active button timestamp" );
323+
324+
this.element.calendar( "option", "value", "invalid" );
325+
assert.dateEqual( this.element.calendar( "option", "value" ), date, "Value after invalid parameter" );
326+
} );
327+
313328
/*
314329
// TODO: Move this to $.date, Globalize or calendar widget
315330
test( "daylightSaving", function() {

0 commit comments

Comments
 (0)