mirror of
https://github.com/frappe/air-datepicker.git
synced 2026-01-14 11:01:22 +08:00
fix .getParsedDates test, add multipleDates test
This commit is contained in:
parent
968c0ec01c
commit
06750cc913
@ -609,7 +609,6 @@ describe('Options', function () {
|
||||
it('if `true` then navigation buttons will be disabled if there is no more possible dates to select to in next or prev month', function () {
|
||||
var date = new Date(2015, 11, 30);
|
||||
|
||||
destroy = false;
|
||||
dp = $input.datepicker({
|
||||
minDate: date,
|
||||
inline: true
|
||||
@ -621,5 +620,33 @@ describe('Options', function () {
|
||||
|
||||
expect($prev.attr('class')).to.have.string('-disabled-')
|
||||
})
|
||||
});
|
||||
|
||||
describe('multipleDates', function () {
|
||||
it('if `true` then one can select multiple dates', function () {
|
||||
dp = $input.datepicker({
|
||||
multipleDates: true
|
||||
}).data('datepicker');
|
||||
|
||||
dp.selectDate(new Date(2016, 0, 7));
|
||||
dp.selectDate(new Date(2016, 0, 8));
|
||||
dp.selectDate(new Date(2016, 0, 9));
|
||||
|
||||
expect(dp.selectedDates).to.have.length(3)
|
||||
});
|
||||
|
||||
it('if `number` should limit length of selected dates by its value', function () {
|
||||
dp = $input.datepicker({
|
||||
multipleDates: 3
|
||||
}).data('datepicker');
|
||||
|
||||
dp.selectDate(new Date(2016, 0, 7));
|
||||
dp.selectDate(new Date(2016, 0, 8));
|
||||
dp.selectDate(new Date(2016, 0, 9));
|
||||
dp.selectDate(new Date(2016, 0, 10));
|
||||
dp.selectDate(new Date(2016, 0, 11));
|
||||
|
||||
expect(dp.selectedDates).to.have.length(3)
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
@ -34,7 +34,7 @@ describe('Datepicker', function () {
|
||||
});
|
||||
describe('.fullMonth', function () {
|
||||
it('`fullMonth` must be equal to current month + 1 with leading zero', function () {
|
||||
assert.equal(currentDate.getMonth() < 10 ? '0' + (currentDate.getMonth()) + 1 : currentDate.getMonth() + 1 , date.fullMonth);
|
||||
assert.equal(currentDate.getMonth() < 10 ? '0' + (currentDate.getMonth() + 1) : currentDate.getMonth() + 1 , date.fullMonth);
|
||||
})
|
||||
});
|
||||
describe('.date', function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user