]> source.dussan.org Git - jquery-ui.git/commitdiff
Calendar tests: Add dateEqual assertion, clean up helper methods
authorFelix Nagel <info@felixnagel.com>
Sun, 22 May 2016 19:12:10 +0000 (21:12 +0200)
committerFelix Nagel <info@felixnagel.com>
Wed, 5 Oct 2016 16:32:11 +0000 (18:32 +0200)
tests/lib/qunit-assert-dateequal.js [new file with mode: 0644]
tests/lib/qunit.js
tests/unit/calendar/core.js
tests/unit/calendar/helper.js
tests/unit/calendar/methods.js
tests/unit/calendar/options.js
tests/unit/datepicker/core.js
tests/unit/datepicker/helper.js
tests/unit/datepicker/methods.js

diff --git a/tests/lib/qunit-assert-dateequal.js b/tests/lib/qunit-assert-dateequal.js
new file mode 100644 (file)
index 0000000..7a99700
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Assertion for comparing Date objects by day, month and year.
+ */
+define( [
+       "qunit"
+], function( QUnit ) {
+
+QUnit.assert.dateEqual = function( value, expected, message ) {
+
+       if ( !value || !expected ) {
+               this.push( false, value, expected,
+                       "dateEqual failed, missing date object, message was: " + message );
+               return;
+       }
+
+       var newValue = new Date( value.getFullYear(), value.getMonth(), value.getDate() ),
+               newExpected = new Date( expected.getFullYear(), expected.getMonth(), expected.getDate() );
+
+       this.push( ( newValue.toString() === newExpected.toString() ), value, expected, message );
+};
+
+} );
index e2a6e85c7f4dc968e9a80470893f35d1d9d755dd..fe5c1d746c5747bb3fdbae494657c4d9aa7f12bc 100644 (file)
@@ -4,6 +4,7 @@ define( [
        "qunit-assert-classes",
        "qunit-assert-close",
        "lib/qunit-assert-domequal",
+       "lib/qunit-assert-dateequal",
        "phantom-bridge"
 ], function( QUnit, $ ) {
 
index 65daf1bd4581ed06ef6ef205043b6af7e55e6933..7945d08910b796b87d0c8796a35700469255b649 100644 (file)
@@ -137,7 +137,7 @@ test( "Localization", function() {
        testLocalization( "After init: " );
 } );
 
-asyncTest( "keyboard handling", function() {
+asyncTest( "keyboard handling", function( assert ) {
        expect( 10 );
 
        var element = $( "#calendar" );
@@ -150,7 +150,7 @@ asyncTest( "keyboard handling", function() {
                        .simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2013, 12 - 1, 31 ),
                                "Keystroke left to switch to previous day"
@@ -167,7 +167,7 @@ asyncTest( "keyboard handling", function() {
                        .simulate( "keydown", { keyCode: $.ui.keyCode.RIGHT } )
                        .simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
 
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        new Date( 2014, 1 - 1, 2 ),
                        "Keystroke right to switch to next day"
@@ -181,7 +181,7 @@ asyncTest( "keyboard handling", function() {
                testHelper.focusGrid( element ).simulate( "keydown", { keyCode: $.ui.keyCode.UP } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2013, 12 - 1, 25 ),
                                "Keystroke up to move to the previous week"
@@ -197,7 +197,7 @@ asyncTest( "keyboard handling", function() {
                testHelper.focusGrid( element ).simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2014, 1 - 1, 8 ),
                                "Keystroke down to move to the next week"
@@ -213,7 +213,7 @@ asyncTest( "keyboard handling", function() {
                testHelper.focusGrid( element ).simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2013, 12 - 1, 1 ),
                                "Keystroke Page Up moves date to previous month"
@@ -230,7 +230,7 @@ asyncTest( "keyboard handling", function() {
                        .simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP, altKey: true } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2013, 1 - 1, 1 ),
                                "Keystroke Page Up + ALT moves date to previous year"
@@ -246,7 +246,7 @@ asyncTest( "keyboard handling", function() {
                testHelper.focusGrid( element ).simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2014, 2 - 1, 1 ),
                                "Keystroke Page Down moves date to next month"
@@ -263,7 +263,7 @@ asyncTest( "keyboard handling", function() {
                        .simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN, altKey: true } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2015, 1 - 1, 1 ),
                                "Keystroke Page Down + ALT moves date to next year"
@@ -280,7 +280,7 @@ asyncTest( "keyboard handling", function() {
                testHelper.focusGrid( element ).simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_UP } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2014, 2 - 1, 28 ),
                                "Keystroke Page Up and short months"
@@ -296,7 +296,7 @@ asyncTest( "keyboard handling", function() {
                testHelper.focusGrid( element ).simulate( "keydown", { keyCode: $.ui.keyCode.PAGE_DOWN } );
                setTimeout( function() {
                        $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-                       testHelper.equalsDate(
+                       assert.dateEqual(
                                element.calendar( "valueAsDate" ),
                                new Date( 2016, 2 - 1, 29 ),
                                "Keystroke Page Down and leap years"
@@ -309,7 +309,7 @@ asyncTest( "keyboard handling", function() {
        step1();
 } );
 
-asyncTest( "mouse", function() {
+asyncTest( "mouse", function( assert ) {
        expect( 6 );
 
        var element = $( "#calendar" ).calendar(),
@@ -318,7 +318,7 @@ asyncTest( "mouse", function() {
        function step1() {
                $( "tbody button:contains(10)", element ).simulate( "mousedown" );
                date.setDate( 10 );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        date,
                        "Mouse click"
@@ -326,7 +326,7 @@ asyncTest( "mouse", function() {
 
                element.calendar( "option", "value", new Date( 2008, 2 - 1, 4 ) );
                $( ".ui-calendar-calendar tbody button:contains(12)", element ).simulate( "mousedown" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        new Date( 2008, 2 - 1, 12 ),
                        "Mouse click - preset"
@@ -336,7 +336,7 @@ asyncTest( "mouse", function() {
                element.calendar( "option", "value", new Date( 2008, 2 - 1, 4 ) );
                $( ".ui-calendar-prev", element ).simulate( "click" );
                $( ".ui-calendar-calendar tbody button:contains(16)", element ).simulate( "mousedown" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        new Date( 2008, 1 - 1, 16 ),
                        "Mouse click - previous"
@@ -345,7 +345,7 @@ asyncTest( "mouse", function() {
                element.calendar( "option", "value", new Date( 2008, 2 - 1, 4 ) );
                $( ".ui-calendar-next", element ).simulate( "click" );
                $( ".ui-calendar-calendar tbody button:contains(18)", element ).simulate( "mousedown" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        new Date( 2008, 3 - 1, 18 ),
                        "Mouse click - next"
@@ -365,7 +365,7 @@ asyncTest( "mouse", function() {
 
                $( ".ui-calendar-prev", element ).simulate( "click" );
                $( "tbody button:contains(16)", element ).simulate( "mousedown" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        new Date( 2008, 2 - 1, 16 ),
                        "Mouse click - previous + min/max"
@@ -383,7 +383,7 @@ asyncTest( "mouse", function() {
 
                $( ".ui-calendar-next", element ).simulate( "click" );
                $( "tbody button:contains(18)", element ).simulate( "mousedown" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        element.calendar( "valueAsDate" ),
                        new Date( 2008, 2 - 1, 18 ),
                        "Mouse click - next + min/max"
index a82e96705a388edcedde00521dd72cd69eb8d74e..b5feff5a67b0a979634a0f8ba1378dad66eac546 100644 (file)
@@ -4,21 +4,6 @@ define( [
 ], function( $, helper ) {
 
 return $.extend( helper, {
-       addMonths: function( date, offset ) {
-               var maxDay = 32 - new Date( date.getFullYear(), date.getMonth() + offset, 32 ).getDate();
-               date.setDate( Math.min( date.getDate(), maxDay ) );
-               date.setMonth( date.getMonth() + offset );
-               return date;
-       },
-       equalsDate: function( d1, d2, message ) {
-               if ( !d1 || !d2 ) {
-                       ok( false, message + " - missing date" );
-                       return;
-               }
-               d1 = new Date( d1.getFullYear(), d1.getMonth(), d1.getDate() );
-               d2 = new Date( d2.getFullYear(), d2.getMonth(), d2.getDate() );
-               equal( d1.toString(), d2.toString(), message );
-       },
        focusGrid: function( element ) {
                element.find( ":tabbable" ).last().simulate( "focus" );
                $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.TAB } );
index 84e26571076b74914d4ced3dd63690fa8b266e81..d5a4ba4a293c09313591b8ac1dd9fe5fe558010d 100644 (file)
@@ -1,8 +1,7 @@
 define( [
        "jquery",
-       "./helper",
        "ui/widgets/calendar"
-], function( $, testHelper ) {
+], function( $ ) {
 
 module( "calendar: methods" );
 
@@ -56,7 +55,7 @@ test( "value", function() {
        equal( element.calendar( "value" ), "1/1/14", "Setting invalid values should be ignored." );
 } );
 
-test( "valueAsDate", function() {
+test( "valueAsDate", function( assert ) {
        expect( 11 );
 
        var minDate, maxDate, dateAndTimeToSet, dateAndTimeClone,
@@ -69,7 +68,7 @@ test( "valueAsDate", function() {
                        .hasClass( "ui-state-active" ),
                "First day marked as selected"
        );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2014, 0, 1 ), "Getter" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2014, 0, 1 ), "Getter" );
 
        element.calendar( "destroy" );
 
@@ -77,7 +76,7 @@ test( "valueAsDate", function() {
        equal( element.calendar( "valueAsDate" ), null, "Set date - default" );
 
        element.calendar( "valueAsDate", date1 );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), date1, "Set date - 2008-06-04" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), date1, "Set date - 2008-06-04" );
 
        // With minimum/maximum
        element = $( "#calendar" ).calendar();
@@ -89,13 +88,13 @@ test( "valueAsDate", function() {
        element
                .calendar( "option", { min: minDate } )
                .calendar( "valueAsDate", date2 );
-       testHelper.equalsDate(
+       assert.dateEqual(
                element.calendar( "valueAsDate" ),
                date2, "Set date min/max - value > min"
        );
 
        element.calendar( "valueAsDate", date1 );
-       testHelper.equalsDate(
+       assert.dateEqual(
                element.calendar( "valueAsDate" ),
                date2,
                "Set date min/max - value < min"
@@ -104,14 +103,14 @@ test( "valueAsDate", function() {
        element
                .calendar( "option", { max: maxDate, min: null } )
                .calendar( "valueAsDate", date1 );
-       testHelper.equalsDate(
+       assert.dateEqual(
                element.calendar( "valueAsDate" ),
                date1,
                "Set date min/max - value < max"
        );
 
        element.calendar( "valueAsDate", date2 );
-       testHelper.equalsDate(
+       assert.dateEqual(
                element.calendar( "valueAsDate" ),
                date1,
                "Set date min/max - value > max"
@@ -120,14 +119,14 @@ test( "valueAsDate", function() {
        element
                .calendar( "option", { min: minDate } )
                .calendar( "valueAsDate", date1 );
-       testHelper.equalsDate(
+       assert.dateEqual(
                element.calendar( "valueAsDate" ),
                date1,
                "Set date min/max - value < min"
        );
 
        element.calendar( "valueAsDate", date2 );
-       testHelper.equalsDate(
+       assert.dateEqual(
                element.calendar( "valueAsDate" ),
                date1, "Set date min/max - value > max"
        );
index c407f096a7375a16180215e0af4813af76bd555e..2e383855beb1bfe0d3e7f730f8c112db98c16c02 100644 (file)
@@ -1,8 +1,7 @@
 define( [
        "jquery",
-       "./helper",
        "ui/widgets/calendar"
-], function( $, testHelper ) {
+], function( $ ) {
 
 module( "calendar: options" );
 
@@ -188,7 +187,7 @@ test( "showWeek", function() {
        equal( container.find( "thead th" ).length, 8, "supports changing option after init" );
 } );
 
-test( "min / max", function() {
+test( "min / max", function( assert ) {
        expect( 17 );
 
        // With existing date
@@ -202,38 +201,38 @@ test( "min / max", function() {
        element
                .calendar( "option", { min: minDate } )
                .calendar( "value", "6/4/08" );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > min" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > min" );
 
        element
                .calendar( "option", { min: minDate } )
                .calendar( "value", "1/4/08" );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < min" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < min" );
 
        element
                .calendar( "option", { min: null } )
                .calendar( "value", "6/4/08" )
                .calendar( "option", { max: maxDate } );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < max" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < max" );
 
        element
                .calendar( "option", { max: maxDate } )
                .calendar( "value", "1/4/09" );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - setDate > max" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - setDate > max" );
 
        element
                .calendar( "option", { min: minDate, max: maxDate } )
                .calendar( "value", "1/4/08" );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < min" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value < min" );
 
        element
                .calendar( "option", { min: minDate, max: maxDate } )
                .calendar( "value", "6/4/08" );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > min, < max" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > min, < max" );
 
        element
                .calendar( "option", { min: minDate, max: maxDate } )
                .calendar( "value", "1/4/09" );
-       testHelper.equalsDate( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > max" );
+       assert.dateEqual( element.calendar( "valueAsDate" ), new Date( 2008, 6 - 1, 4 ), "Min/max - value > max" );
 
        element
                .calendar( "option", { min: minDate, max: maxDate } )
index 3370320753f4744a89bf6322859fbf7d485c55cf..f884e9680ed6829ad68e490f4ba5df03e97878e6 100644 (file)
@@ -41,7 +41,7 @@ asyncTest( "base structure", function() {
        }, 50 );
 } );
 
-asyncTest( "Keyboard handling: input", function() {
+asyncTest( "Keyboard handling: input", function( assert ) {
        expect( 10 );
        var picker, instance,
                input = $( "#datepicker" ).datepicker();
@@ -84,7 +84,7 @@ asyncTest( "Keyboard handling: input", function() {
                        .datepicker( "refresh" )
                        .datepicker( "open" )
                        .simulate( "keydown", { keyCode: $.ui.keyCode.ENTER } );
-               testHelper.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
+               assert.dateEqual( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
                        "Keystroke enter - preset" );
 
                input
@@ -99,7 +99,7 @@ asyncTest( "Keyboard handling: input", function() {
                        .val( "1/1/14" )
                        .datepicker( "open" )
                        .simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
-               testHelper.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
+               assert.dateEqual( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
                        "Keystroke esc - preset" );
 
                input
@@ -107,13 +107,13 @@ asyncTest( "Keyboard handling: input", function() {
                        .datepicker( "open" )
                        .simulate( "keydown", { ctrlKey: true, keyCode: $.ui.keyCode.PAGE_UP } )
                        .simulate( "keydown", { keyCode: $.ui.keyCode.ESCAPE } );
-               testHelper.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
+               assert.dateEqual( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ),
                        "Keystroke esc - abandoned" );
 
                input
                        .val( "1/2/14" )
                        .simulate( "keyup" );
-               testHelper.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 2 ),
+               assert.dateEqual( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 2 ),
                        "Picker updated as user types into input" );
 
                input.datepicker( "destroy" );
@@ -128,7 +128,7 @@ test( "ARIA", function() {
        expect( 0 );
 } );
 
-asyncTest( "mouse", function() {
+asyncTest( "mouse", function( assert ) {
        expect( 4 );
 
        var input = testHelper.init( $( "#datepicker" ).val( "" ) ),
@@ -139,7 +139,7 @@ asyncTest( "mouse", function() {
        setTimeout( function() {
                input.val( "4/4/08" ).datepicker( "refresh" ).datepicker( "open" );
                $( ".ui-calendar-calendar tbody button:contains(12)", picker ).simulate( "mousedown", {} );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        input.datepicker( "valueAsDate" ),
                        new Date( 2008, 4 - 1, 12 ),
                        "Mouse click - preset"
@@ -151,7 +151,7 @@ asyncTest( "mouse", function() {
 
                input.val( "4/4/08" ).datepicker( "refresh" ).datepicker( "open" );
                input.simulate( "click" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        input.datepicker( "valueAsDate" ),
                        new Date( 2008, 4 - 1, 4 ),
                        "Mouse click - close + preset"
@@ -160,7 +160,7 @@ asyncTest( "mouse", function() {
                input.val( "4/4/08" ).datepicker( "refresh" ).datepicker( "open" );
                picker.find( "a.ui-calendar-prev" ).simulate( "click" );
                input.simulate( "click" );
-               testHelper.equalsDate(
+               assert.dateEqual(
                        input.datepicker( "valueAsDate" ),
                        new Date( 2008, 4 - 1, 4 ),
                        "Mouse click - abandoned"
index 81fdd9d003139e96aeb336387fc72c89ba80af3a..da75cf77047a84a0e8c4d01751b819b60fb013f3 100644 (file)
@@ -5,21 +5,6 @@ define( [
 ], function( $, helper ) {
 
 return $.extend( helper, {
-       addMonths: function( date, offset ) {
-               var maxDay = 32 - new Date( date.getFullYear(), date.getMonth() + offset, 32 ).getDate();
-               date.setDate( Math.min( date.getDate(), maxDay ) );
-               date.setMonth( date.getMonth() + offset );
-               return date;
-       },
-       equalsDate: function( d1, d2, message ) {
-               if ( !d1 || !d2 ) {
-                       ok( false, message + " - missing date" );
-                       return;
-               }
-               d1 = new Date( d1.getFullYear(), d1.getMonth(), d1.getDate() );
-               d2 = new Date( d2.getFullYear(), d2.getMonth(), d2.getDate() );
-               equal( d1.toString(), d2.toString(), message );
-       },
        init: function( id, options ) {
                options = $.extend( { show: false, hide: false }, options || {} );
                return $( id ).datepicker( options );
index 2cf83569819681d8d499c4d975a48c6c92a7d68c..a274de3f9da7b3b41dcc64238ae77fd1e9ab649f 100644 (file)
@@ -86,7 +86,7 @@ test( "value", function() {
        strictEqual( input.datepicker( "value" ), null, "Invalid values should return null." );
 } );
 
-test( "valueAsDate", function() {
+test( "valueAsDate", function( assert ) {
        expect( 6 );
 
        var input = testHelper.init( "#datepicker" ),
@@ -99,7 +99,7 @@ test( "valueAsDate", function() {
                picker.find( "button[data-timestamp]" ).eq( 0 ).hasClass( "ui-state-active" ),
                "First day marked as selected"
        );
-       testHelper.equalsDate( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ), "Getter" );
+       assert.dateEqual( input.datepicker( "valueAsDate" ), new Date( 2014, 0, 1 ), "Getter" );
 
        input.val( "a/b/c" );
        equal( input.datepicker( "valueAsDate" ), null, "Invalid dates return null" );
@@ -109,7 +109,7 @@ test( "valueAsDate", function() {
 
        strictEqual( input.datepicker( "valueAsDate" ), null, "Set date - default" );
        input.datepicker( "valueAsDate", date1 );
-       testHelper.equalsDate( input.datepicker( "valueAsDate" ), date1, "Set date - 2008-06-04" );
+       assert.dateEqual( input.datepicker( "valueAsDate" ), date1, "Set date - 2008-06-04" );
 } );
 
 test( "isValid", function() {