Skip to content

Commit 00e979b

Browse files
authored
Merge pull request #1983 from jelhan/test-1980
add tests for setDatesDisabled function
2 parents fa0a0ec + 15b9d17 commit 00e979b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tests/suites/methods.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module('Methods', {
44
.appendTo('#qunit-fixture')
55
.datepicker({format: "dd-mm-yyyy"});
66
this.dp = this.input.data('datepicker');
7+
this.picker = this.dp.picker;
78
},
89
teardown: function(){
910
this.dp.remove();
@@ -137,8 +138,11 @@ test('setDaysOfWeekDisabled - Array', function(){
137138
});
138139

139140
test('setDatesDisabled', function(){
140-
var returnedObject = this.dp.setDatesDisabled([]);
141-
// ...
141+
var monthShown = this.picker.find('.datepicker-days thead th.datepicker-switch');
142+
var returnedObject = this.dp.setDatesDisabled(['01-03-2011']);
143+
ok(this.picker.find('.datepicker-days tbody td.day:not(.old):first').hasClass('disabled'), 'day is disabled');
144+
this.dp.setDatesDisabled(['01-01-2011']);
145+
equal(monthShown.text(), 'March 2011', 'should not change viewDate');
142146
strictEqual(returnedObject, this.dp, "is chainable");
143147
});
144148

0 commit comments

Comments
 (0)