Skip to content

Commit a31bc8b

Browse files
committed
Date tests: Add basic timestamp tests
1 parent 4267e42 commit a31bc8b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tests/unit/date/core.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ QUnit.test( "Instantiation", function( assert ) {
1515
assert.ok( $.ui.date( null, attributes ) instanceof $.ui.date, "instantiation without new" );
1616
} );
1717

18-
QUnit.test( "Check Sets and Gets", 4, function( assert ) {
18+
QUnit.test( "Check Sets and Gets", 6, function( assert ) {
1919
var date = $.ui.date( null, attributes );
20-
assert.equal( date.setDay( 15 ).day(), 15, "Set day and retrieve" );
2120
assert.equal( date.setFullDate( 2012, 9, 15 ).year(), 2012, "Set full date and retrieve year" );
2221
assert.equal( date.month(), 9, "Set full date and retrieve month" );
2322
assert.equal( date.day(), 15, "Set full date and retrieve day" );
2423

25-
// TODO Add setTime test
24+
assert.equal( date.setTimestamp( 1490912843735 ).year(), 2017, "Set timestamp and retrieve year" );
25+
assert.equal( date.month(), 2, "Set timestamp and retrieve month" );
26+
assert.equal( date.day(), 31, "Set timestamp and retrieve day" );
2627
} );
2728

2829
QUnit.test( "Date Adjustments - Normal Use Cases", 10, function( assert ) {
@@ -119,8 +120,6 @@ QUnit.test( "Clone", 2, function( assert ) {
119120
} );
120121

121122
QUnit.test( "Days", 1, function( assert ) {
122-
123-
// TODO Needs work
124123
var date = $.ui.date( null, attributes );
125124
date.eachDay = function( day ) {
126125
if ( day.lead && day.date > 20 ) {

0 commit comments

Comments
 (0)