aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2016-12-12 00:15:46 +0100
committerFelix Nagel <info@felixnagel.com>2017-01-25 18:29:45 +0100
commit188550faff8baefff96e36b4094ad7fd00c91c45 (patch)
tree3ebbabc4f8ecf047a1cfa03acf8a1cf2421693b9 /tests
parent00a470b435608940c4d829e91d00b587294af0eb (diff)
downloadjquery-ui-188550faff8baefff96e36b4094ad7fd00c91c45.tar.gz
jquery-ui-188550faff8baefff96e36b4094ad7fd00c91c45.zip
Calendar: Make sure option numberOfMonth could be changed after creation
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/calendar/options.js16
1 files changed, 5 insertions, 11 deletions
diff --git a/tests/unit/calendar/options.js b/tests/unit/calendar/options.js
index c77841359..abfbaf016 100644
--- a/tests/unit/calendar/options.js
+++ b/tests/unit/calendar/options.js
@@ -278,13 +278,10 @@ QUnit.test( "numberOfMonths", function( assert ) {
var date = new Date( 2015, 8 - 1, 1 );
- // Number of month option does not work after init
- this.element
- .calendar( "destroy" )
- .calendar( {
- numberOfMonths: 3,
- value: date
- } );
+ this.element.calendar( "option", {
+ numberOfMonths: 3,
+ value: date
+ } );
assert.equal( this.widget.find( ".ui-calendar-group" ).length, 3, "3 calendar grids" );
assert.equal(
@@ -304,10 +301,7 @@ QUnit.test( "numberOfMonths", function( assert ) {
"After mousedown last month: Last day is Saturday"
);
- // Test if using cursor to go to the next / prev month advances three month
- // Focus doesn't work here so we use an additional mouse down event
- this.widget.find( "tbody:first td[id]:first button" ).trigger( "mousedown" );
- $( document.activeElement ).simulate( "keydown", { keyCode: $.ui.keyCode.LEFT } );
+ this.widget.find( "button.ui-calendar-prev" ).simulate( "click" );
assert.equal( this.widget.find( ".ui-calendar-month:first" ).text(), "May",
"After move to previous month: First month is May"
);