diff options
author | Felix Nagel <info@felixnagel.com> | 2016-12-11 23:30:25 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2017-01-21 13:49:36 +0100 |
commit | 767d1730403ff2d184717b43042d3ba98b71596c (patch) | |
tree | 061bdc941b8af047ff8fe738148b5203c3e1a872 /tests/unit | |
parent | 8b864309f646f67f7fca88f87a9dea4fe5526aba (diff) | |
download | jquery-ui-767d1730403ff2d184717b43042d3ba98b71596c.tar.gz jquery-ui-767d1730403ff2d184717b43042d3ba98b71596c.zip |
Calendar: Introduce refresh callback event
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/calendar/common.js | 1 | ||||
-rw-r--r-- | tests/unit/calendar/events.js | 22 | ||||
-rw-r--r-- | tests/unit/datepicker/common.js | 1 | ||||
-rw-r--r-- | tests/unit/datepicker/events.js | 18 |
4 files changed, 42 insertions, 0 deletions
diff --git a/tests/unit/calendar/common.js b/tests/unit/calendar/common.js index ea637a9b8..1f3a0fe21 100644 --- a/tests/unit/calendar/common.js +++ b/tests/unit/calendar/common.js @@ -37,6 +37,7 @@ common.testWidget( "calendar", { // callbacks change: null, create: null, + refresh: null, select: null } } ); diff --git a/tests/unit/calendar/events.js b/tests/unit/calendar/events.js index 6dc2e5eef..7148ff343 100644 --- a/tests/unit/calendar/events.js +++ b/tests/unit/calendar/events.js @@ -98,4 +98,26 @@ QUnit.test( "select", function( assert ) { step1(); } ); +QUnit.test( "refresh", function( assert ) { + assert.expect( 2 ); + + var shouldFire; + + this.element.calendar( { + refresh: function() { + assert.ok( shouldFire, "refresh event fired" ); + } + } ); + + shouldFire = true; + this.element.find( "button.ui-calendar-next" ).simulate( "click" ); + + shouldFire = false; + this.element.find( "table button:eq(1)" ).simulate( "click" ); + + testHelper.focusGrid( this.element ).simulate( "keydown", { keyCode: $.ui.keyCode.END } ); + shouldFire = true; + testHelper.focusGrid( this.element ).simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } ); +} ); + } ); diff --git a/tests/unit/datepicker/common.js b/tests/unit/datepicker/common.js index 527ddcbf3..6b0b0487d 100644 --- a/tests/unit/datepicker/common.js +++ b/tests/unit/datepicker/common.js @@ -46,6 +46,7 @@ common.testWidget( "datepicker", { close: null, create: null, open: null, + refresh: null, select: null } } ); diff --git a/tests/unit/datepicker/events.js b/tests/unit/datepicker/events.js index 76615084c..5a923d252 100644 --- a/tests/unit/datepicker/events.js +++ b/tests/unit/datepicker/events.js @@ -180,4 +180,22 @@ QUnit.test( "select", function( assert ) { step1(); } ); +QUnit.test( "refresh", function( assert ) { + assert.expect( 1 ); + + var shouldFire; + + this.element.calendar( { + refresh: function() { + assert.ok( shouldFire, "refresh event fired" ); + } + } ); + + shouldFire = true; + this.element.find( "button.ui-calendar-next" ).simulate( "click" ); + + shouldFire = false; + this.element.find( "table button:eq(1)" ).simulate( "click" ); +} ); + } ); |