diff options
author | Felix Nagel <info@felixnagel.com> | 2016-05-22 22:23:01 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2016-10-12 01:04:25 +0200 |
commit | 877937e5c64667de6936c824115a76b6bb10c2e2 (patch) | |
tree | 988032932f7b7d00897c101e622a7b3e1c5c18da | |
parent | 18ad526cfdcd30006f9766f23407e17d9dd295ee (diff) | |
download | jquery-ui-877937e5c64667de6936c824115a76b6bb10c2e2.tar.gz jquery-ui-877937e5c64667de6936c824115a76b6bb10c2e2.zip |
Calendar tests: Add basic value option tests
-rw-r--r-- | tests/unit/calendar/options.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/unit/calendar/options.js b/tests/unit/calendar/options.js index 281598794..9fb49b362 100644 --- a/tests/unit/calendar/options.js +++ b/tests/unit/calendar/options.js @@ -310,6 +310,21 @@ test( "numberOfMonths", function() { ); } ); +test( "value", function( assert ) { + expect( 4 ); + + var date = new Date( 2016, 5 - 1, 23 ); + + assert.equal( this.element.calendar( "option", "value" ), null, "Initial value" ); + + this.element.calendar( "option", "value", date ); + assert.dateEqual( this.element.calendar( "option", "value" ), date, "Value set" ); + equal( this.widget.find( "table button.ui-state-active" ).data( "timestamp" ), 1463954400000, "Active button timestamp" ); + + this.element.calendar( "option", "value", "invalid" ); + assert.dateEqual( this.element.calendar( "option", "value" ), date, "Value after invalid parameter" ); +} ); + /* // TODO: Move this to $.date, Globalize or calendar widget test( "daylightSaving", function() { |