aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2017-03-31 21:30:40 +0200
committerFelix Nagel <info@felixnagel.com>2017-03-31 21:30:40 +0200
commita31bc8b7ee04bca6f423c5a9d134a2fa01ad5caa (patch)
tree575d35edc15f94ad5ee80f697aa0f264589a7f9a
parent4267e4283ca6259d5e7612c8dd66024f766b1595 (diff)
downloadjquery-ui-a31bc8b7ee04bca6f423c5a9d134a2fa01ad5caa.tar.gz
jquery-ui-a31bc8b7ee04bca6f423c5a9d134a2fa01ad5caa.zip
Date tests: Add basic timestamp tests
-rw-r--r--tests/unit/date/core.js9
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/unit/date/core.js b/tests/unit/date/core.js
index fc4dcd975..e52ab183c 100644
--- a/tests/unit/date/core.js
+++ b/tests/unit/date/core.js
@@ -15,14 +15,15 @@ QUnit.test( "Instantiation", function( assert ) {
assert.ok( $.ui.date( null, attributes ) instanceof $.ui.date, "instantiation without new" );
} );
-QUnit.test( "Check Sets and Gets", 4, function( assert ) {
+QUnit.test( "Check Sets and Gets", 6, function( assert ) {
var date = $.ui.date( null, attributes );
- assert.equal( date.setDay( 15 ).day(), 15, "Set day and retrieve" );
assert.equal( date.setFullDate( 2012, 9, 15 ).year(), 2012, "Set full date and retrieve year" );
assert.equal( date.month(), 9, "Set full date and retrieve month" );
assert.equal( date.day(), 15, "Set full date and retrieve day" );
- // TODO Add setTime test
+ assert.equal( date.setTimestamp( 1490912843735 ).year(), 2017, "Set timestamp and retrieve year" );
+ assert.equal( date.month(), 2, "Set timestamp and retrieve month" );
+ assert.equal( date.day(), 31, "Set timestamp and retrieve day" );
} );
QUnit.test( "Date Adjustments - Normal Use Cases", 10, function( assert ) {
@@ -119,8 +120,6 @@ QUnit.test( "Clone", 2, function( assert ) {
} );
QUnit.test( "Days", 1, function( assert ) {
-
- // TODO Needs work
var date = $.ui.date( null, attributes );
date.eachDay = function( day ) {
if ( day.lead && day.date > 20 ) {