@ohos-ports/flowbite-datepicker 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -0
- package/.eslintrc.js +73 -0
- package/.stylelintrc +12 -0
- package/CHANGELOG.md +72 -0
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/demo/index.html +582 -0
- package/demo/live-demo.js +471 -0
- package/dist/DateRangePicker.cjs.js +2996 -0
- package/dist/DateRangePicker.esm.js +2994 -0
- package/dist/DateRangePicker.umd.js +3002 -0
- package/dist/Datepicker.cjs.js +2778 -0
- package/dist/Datepicker.esm.js +2776 -0
- package/dist/Datepicker.umd.js +2784 -0
- package/dist/css/datepicker-bs4.css +276 -0
- package/dist/css/datepicker-bs4.min.css +1 -0
- package/dist/css/datepicker-bs5.css +276 -0
- package/dist/css/datepicker-bs5.min.css +1 -0
- package/dist/css/datepicker-bulma.css +258 -0
- package/dist/css/datepicker-bulma.min.css +1 -0
- package/dist/css/datepicker-foundation.css +262 -0
- package/dist/css/datepicker-foundation.min.css +1 -0
- package/dist/css/datepicker.css +306 -0
- package/dist/css/datepicker.min.css +1403 -0
- package/dist/js/datepicker-full.js +2777 -0
- package/dist/js/datepicker-full.min.js +1 -0
- package/dist/js/datepicker.js +2569 -0
- package/dist/js/datepicker.min.js +1 -0
- package/dist/js/locales/ar-tn.js +15 -0
- package/dist/js/locales/ar.js +15 -0
- package/dist/js/locales/az.js +14 -0
- package/dist/js/locales/bg.js +14 -0
- package/dist/js/locales/bm.js +18 -0
- package/dist/js/locales/bn.js +19 -0
- package/dist/js/locales/br.js +18 -0
- package/dist/js/locales/bs.js +15 -0
- package/dist/js/locales/ca.js +18 -0
- package/dist/js/locales/cs.js +19 -0
- package/dist/js/locales/cy.js +14 -0
- package/dist/js/locales/da.js +19 -0
- package/dist/js/locales/de.js +18 -0
- package/dist/js/locales/el.js +16 -0
- package/dist/js/locales/en-AU.js +18 -0
- package/dist/js/locales/en-CA.js +18 -0
- package/dist/js/locales/en-GB.js +18 -0
- package/dist/js/locales/en-IE.js +17 -0
- package/dist/js/locales/en-NZ.js +17 -0
- package/dist/js/locales/en-ZA.js +17 -0
- package/dist/js/locales/eo.js +17 -0
- package/dist/js/locales/es.js +18 -0
- package/dist/js/locales/et.js +18 -0
- package/dist/js/locales/eu.js +18 -0
- package/dist/js/locales/fa.js +17 -0
- package/dist/js/locales/fi.js +17 -0
- package/dist/js/locales/fo.js +15 -0
- package/dist/js/locales/fr-CH.js +21 -0
- package/dist/js/locales/fr.js +18 -0
- package/dist/js/locales/gl.js +16 -0
- package/dist/js/locales/he.js +15 -0
- package/dist/js/locales/hi.js +18 -0
- package/dist/js/locales/hr.js +13 -0
- package/dist/js/locales/hu.js +18 -0
- package/dist/js/locales/hy.js +18 -0
- package/dist/js/locales/id.js +15 -0
- package/dist/js/locales/is.js +14 -0
- package/dist/js/locales/it-CH.js +20 -0
- package/dist/js/locales/it.js +18 -0
- package/dist/js/locales/ja.js +17 -0
- package/dist/js/locales/ka.js +17 -0
- package/dist/js/locales/kk.js +15 -0
- package/dist/js/locales/km.js +15 -0
- package/dist/js/locales/ko.js +18 -0
- package/dist/js/locales/lt.js +19 -0
- package/dist/js/locales/lv.js +18 -0
- package/dist/js/locales/me.js +17 -0
- package/dist/js/locales/mk.js +15 -0
- package/dist/js/locales/mn.js +17 -0
- package/dist/js/locales/mr.js +18 -0
- package/dist/js/locales/ms.js +15 -0
- package/dist/js/locales/nl-BE.js +18 -0
- package/dist/js/locales/nl.js +18 -0
- package/dist/js/locales/no.js +18 -0
- package/dist/js/locales/oc.js +17 -0
- package/dist/js/locales/pl.js +17 -0
- package/dist/js/locales/pt-BR.js +17 -0
- package/dist/js/locales/pt.js +18 -0
- package/dist/js/locales/ro.js +17 -0
- package/dist/js/locales/ru.js +18 -0
- package/dist/js/locales/si.js +18 -0
- package/dist/js/locales/sk.js +18 -0
- package/dist/js/locales/sl.js +15 -0
- package/dist/js/locales/sq.js +18 -0
- package/dist/js/locales/sr-latn.js +16 -0
- package/dist/js/locales/sr.js +16 -0
- package/dist/js/locales/sv.js +17 -0
- package/dist/js/locales/sw.js +15 -0
- package/dist/js/locales/ta.js +18 -0
- package/dist/js/locales/tg.js +19 -0
- package/dist/js/locales/th.js +14 -0
- package/dist/js/locales/tk.js +18 -0
- package/dist/js/locales/tr.js +17 -0
- package/dist/js/locales/uk.js +17 -0
- package/dist/js/locales/uz-cyrl.js +18 -0
- package/dist/js/locales/uz-latn.js +18 -0
- package/dist/js/locales/vi.js +16 -0
- package/dist/js/locales/zh-CN.js +19 -0
- package/dist/js/locales/zh-TW.js +18 -0
- package/dist/locales/index.cjs.js +1028 -0
- package/dist/locales/index.esm.js +1028 -0
- package/dist/main.cjs.js +2999 -0
- package/dist/main.esm.js +2994 -0
- package/dist/main.umd.js +3005 -0
- package/docs/.nojekyll +0 -0
- package/docs/README.md +266 -0
- package/docs/_sidebar.md +6 -0
- package/docs/api.md +284 -0
- package/docs/date-string+format.md +90 -0
- package/docs/i18n.md +99 -0
- package/docs/images/datepicker-inline.jpg +0 -0
- package/docs/images/datepicker.jpg +0 -0
- package/docs/images/multidate.jpg +0 -0
- package/docs/images/picker-structure.jpg +0 -0
- package/docs/images/rangepicker.jpg +0 -0
- package/docs/images/view-days.jpg +0 -0
- package/docs/images/view-decades.jpg +0 -0
- package/docs/images/view-months.jpg +0 -0
- package/docs/images/view-years.jpg +0 -0
- package/docs/index.html +26 -0
- package/docs/options.md +354 -0
- package/docs/overview.md +174 -0
- package/extras/twoDigitToFullYear/test/twoDigitToFullYear.js +58 -0
- package/extras/twoDigitToFullYear/twoDigitToFullYear.js +26 -0
- package/js/DateRangePicker.js +210 -0
- package/js/Datepicker.js +487 -0
- package/js/datepicker-full.js +5 -0
- package/js/events/functions.js +48 -0
- package/js/events/inputFieldListeners.js +206 -0
- package/js/events/otherListeners.js +15 -0
- package/js/events/pickerListeners.js +70 -0
- package/js/i18n/base-locales.js +13 -0
- package/js/i18n/locales/ar-tn.js +15 -0
- package/js/i18n/locales/ar.js +15 -0
- package/js/i18n/locales/az.js +14 -0
- package/js/i18n/locales/bg.js +14 -0
- package/js/i18n/locales/bm.js +18 -0
- package/js/i18n/locales/bn.js +19 -0
- package/js/i18n/locales/br.js +18 -0
- package/js/i18n/locales/bs.js +15 -0
- package/js/i18n/locales/ca.js +18 -0
- package/js/i18n/locales/cs.js +19 -0
- package/js/i18n/locales/cy.js +14 -0
- package/js/i18n/locales/da.js +19 -0
- package/js/i18n/locales/de.js +18 -0
- package/js/i18n/locales/el.js +16 -0
- package/js/i18n/locales/en-AU.js +18 -0
- package/js/i18n/locales/en-CA.js +18 -0
- package/js/i18n/locales/en-GB.js +18 -0
- package/js/i18n/locales/en-IE.js +17 -0
- package/js/i18n/locales/en-NZ.js +17 -0
- package/js/i18n/locales/en-ZA.js +17 -0
- package/js/i18n/locales/eo.js +17 -0
- package/js/i18n/locales/es.js +18 -0
- package/js/i18n/locales/et.js +18 -0
- package/js/i18n/locales/eu.js +18 -0
- package/js/i18n/locales/fa.js +17 -0
- package/js/i18n/locales/fi.js +17 -0
- package/js/i18n/locales/fo.js +15 -0
- package/js/i18n/locales/fr-CH.js +21 -0
- package/js/i18n/locales/fr.js +18 -0
- package/js/i18n/locales/gl.js +16 -0
- package/js/i18n/locales/he.js +15 -0
- package/js/i18n/locales/hi.js +18 -0
- package/js/i18n/locales/hr.js +13 -0
- package/js/i18n/locales/hu.js +18 -0
- package/js/i18n/locales/hy.js +18 -0
- package/js/i18n/locales/id.js +15 -0
- package/js/i18n/locales/is.js +14 -0
- package/js/i18n/locales/it-CH.js +20 -0
- package/js/i18n/locales/it.js +18 -0
- package/js/i18n/locales/ja.js +17 -0
- package/js/i18n/locales/ka.js +17 -0
- package/js/i18n/locales/kk.js +15 -0
- package/js/i18n/locales/km.js +15 -0
- package/js/i18n/locales/ko.js +18 -0
- package/js/i18n/locales/lt.js +19 -0
- package/js/i18n/locales/lv.js +18 -0
- package/js/i18n/locales/me.js +17 -0
- package/js/i18n/locales/mk.js +15 -0
- package/js/i18n/locales/mn.js +17 -0
- package/js/i18n/locales/mr.js +18 -0
- package/js/i18n/locales/ms.js +15 -0
- package/js/i18n/locales/nl-BE.js +18 -0
- package/js/i18n/locales/nl.js +18 -0
- package/js/i18n/locales/no.js +18 -0
- package/js/i18n/locales/oc.js +17 -0
- package/js/i18n/locales/pl.js +17 -0
- package/js/i18n/locales/pt-BR.js +17 -0
- package/js/i18n/locales/pt.js +18 -0
- package/js/i18n/locales/ro.js +17 -0
- package/js/i18n/locales/ru.js +18 -0
- package/js/i18n/locales/si.js +18 -0
- package/js/i18n/locales/sk.js +18 -0
- package/js/i18n/locales/sl.js +15 -0
- package/js/i18n/locales/sq.js +18 -0
- package/js/i18n/locales/sr-latn.js +16 -0
- package/js/i18n/locales/sr.js +16 -0
- package/js/i18n/locales/sv.js +17 -0
- package/js/i18n/locales/sw.js +15 -0
- package/js/i18n/locales/ta.js +18 -0
- package/js/i18n/locales/tg.js +19 -0
- package/js/i18n/locales/th.js +14 -0
- package/js/i18n/locales/tk.js +18 -0
- package/js/i18n/locales/tr.js +17 -0
- package/js/i18n/locales/uk.js +17 -0
- package/js/i18n/locales/uz-cyrl.js +18 -0
- package/js/i18n/locales/uz-latn.js +18 -0
- package/js/i18n/locales/vi.js +16 -0
- package/js/i18n/locales/zh-CN.js +19 -0
- package/js/i18n/locales/zh-TW.js +18 -0
- package/js/lib/date-format.js +185 -0
- package/js/lib/date.js +82 -0
- package/js/lib/dom.js +55 -0
- package/js/lib/event.js +68 -0
- package/js/lib/utils.js +61 -0
- package/js/main.js +4 -0
- package/js/options/defaultOptions.js +38 -0
- package/js/options/processOptions.js +263 -0
- package/js/picker/Picker.js +334 -0
- package/js/picker/templates/calendarWeeksTemplate.js +8 -0
- package/js/picker/templates/daysTemplate.js +8 -0
- package/js/picker/templates/pickerTemplate.js +23 -0
- package/js/picker/views/DaysView.js +250 -0
- package/js/picker/views/MonthsView.js +198 -0
- package/js/picker/views/View.js +55 -0
- package/js/picker/views/YearsView.js +170 -0
- package/package.json +81 -0
- package/postcss.config.js +5 -0
- package/rollup.config.js +75 -0
- package/sass/_mixins.scss +12 -0
- package/sass/datepicker-bs4.scss +91 -0
- package/sass/datepicker-bs5.scss +91 -0
- package/sass/datepicker-bulma.scss +69 -0
- package/sass/datepicker-foundation.scss +66 -0
- package/sass/datepicker.scss +436 -0
- package/sass/index-bs4.scss +5 -0
- package/sass/index-bs5.scss +5 -0
- package/sass/index-bulma.scss +6 -0
- package/sass/index-foundation.scss +3 -0
- package/scripts/build-css.js +39 -0
- package/scripts/build-locales.js +57 -0
- package/scripts/convert-bsdp-locales.js +65 -0
- package/scripts/minify-css.js +31 -0
- package/scripts/minify-js.js +17 -0
- package/style.css +10 -0
- package/tailwind.config.js +16 -0
- package/tailwind.css +1389 -0
- package/test/DateRangePicker/DateRangePicker.js +547 -0
- package/test/DateRangePicker/api-methods.js +415 -0
- package/test/DateRangePicker/date-selection.js +472 -0
- package/test/DateRangePicker/options.js +308 -0
- package/test/Datepicker/Datepicker-object.js +236 -0
- package/test/Datepicker/api-methods.js +328 -0
- package/test/_utils/date.js +102 -0
- package/test/_utils/dom.js +70 -0
- package/test/events.js +785 -0
- package/test/inline-mode.js +45 -0
- package/test/keyboard-operation/arrow-down.js +293 -0
- package/test/keyboard-operation/arrow-left.js +255 -0
- package/test/keyboard-operation/arrow-right.js +215 -0
- package/test/keyboard-operation/arrow-up.js +461 -0
- package/test/keyboard-operation/edit-mode.js +458 -0
- package/test/keyboard-operation/keyboard-operation.js +146 -0
- package/test/mouse-operation.js +580 -0
- package/test/options/before-show.js +635 -0
- package/test/options/bulma-datepicker.sublime-workspace +1280 -0
- package/test/options/buttons.js +383 -0
- package/test/options/date-restrictions.js +802 -0
- package/test/options/format.js +281 -0
- package/test/options/multidate.js +380 -0
- package/test/options/options.js +727 -0
- package/test/options/orientation.js +410 -0
- package/test/options/pick-levle+view.js +357 -0
- package/test/test.html +94 -0
- package/test/unit/DateRangePicker.js +192 -0
- package/test/unit/Datepicker.js +307 -0
- package/test/unit/_setup.js +28 -0
- package/test/unit/lib/date-format.js +310 -0
- package/test/unit/lib/date.js +211 -0
- package/test/unit/lib/dom.js +142 -0
- package/test/unit/lib/event.js +207 -0
- package/test/unit/lib/utils.js +135 -0
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
describe('DateRangePicker - options', function () {
|
|
2
|
+
let clock;
|
|
3
|
+
let elem;
|
|
4
|
+
let input0;
|
|
5
|
+
let input1;
|
|
6
|
+
|
|
7
|
+
before(function () {
|
|
8
|
+
clock = sinon.useFakeTimers({now: new Date(2020, 1, 14)});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
after(function () {
|
|
12
|
+
clock.restore();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(function () {
|
|
16
|
+
elem = domUtils.parseHTML('<div><input><input></div>').firstChild;
|
|
17
|
+
[input0, input1] = elem.children;
|
|
18
|
+
testContainer.appendChild(elem);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
afterEach(function () {
|
|
22
|
+
testContainer.removeChild(elem);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
describe('allowOneSidedRange', function () {
|
|
26
|
+
it('disables the requirement for both sides of range to be set/unset', function () {
|
|
27
|
+
let {drp, picker0, picker1} = createDRP(elem, {allowOneSidedRange: true});
|
|
28
|
+
let cells0 = getCells(picker0);
|
|
29
|
+
let cells1 = getCells(picker1);
|
|
30
|
+
|
|
31
|
+
drp.datepickers[0].show();
|
|
32
|
+
cells0[16].click();
|
|
33
|
+
|
|
34
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 11), undefined]);
|
|
35
|
+
expect(drp.getDates(), 'to equal', [new Date(drp.dates[0]), undefined]);
|
|
36
|
+
expect(input0.value, 'to be', '02/11/2020');
|
|
37
|
+
expect(filterCells(cells0, '.selected'), 'to equal', [cells0[16]]);
|
|
38
|
+
expect(filterCells(cells0, '.range-start'), 'to equal', [cells0[16]]);
|
|
39
|
+
expect(filterCells(cells0, '.range-end'), 'to equal', []);
|
|
40
|
+
expect(filterCells(cells0, '.range'), 'to equal', []);
|
|
41
|
+
expect(filterCells(cells0, '.focused'), 'to equal', [cells0[16]]);
|
|
42
|
+
|
|
43
|
+
expect(input1.value, 'to be', '');
|
|
44
|
+
expect(filterCells(cells1, '.selected'), 'to equal', []);
|
|
45
|
+
expect(filterCells(cells1, '.range-start'), 'to equal', [cells1[16]]);
|
|
46
|
+
expect(filterCells(cells1, '.range-end'), 'to equal', []);
|
|
47
|
+
expect(filterCells(cells1, '.range'), 'to equal', []);
|
|
48
|
+
expect(filterCells(cells1, '.focused'), 'to equal', [cells1[19]]);
|
|
49
|
+
|
|
50
|
+
drp.datepickers[1].show();
|
|
51
|
+
cells1[25].click();
|
|
52
|
+
|
|
53
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 11), dateValue(2020, 1, 20)]);
|
|
54
|
+
expect(drp.getDates(), 'to equal', drp.dates.map(date => new Date(date)));
|
|
55
|
+
expect(input0.value, 'to be', '02/11/2020');
|
|
56
|
+
expect(filterCells(cells0, '.selected'), 'to equal', [cells0[16]]);
|
|
57
|
+
expect(filterCells(cells0, '.range-start'), 'to equal', [cells0[16]]);
|
|
58
|
+
expect(filterCells(cells0, '.range-end'), 'to equal', [cells0[25]]);
|
|
59
|
+
expect(filterCells(cells0, '.range'), 'to equal', cells0.slice(17, 25));
|
|
60
|
+
expect(filterCells(cells0, '.focused'), 'to equal', [cells0[16]]);
|
|
61
|
+
|
|
62
|
+
expect(input1.value, 'to be', '02/20/2020');
|
|
63
|
+
expect(filterCells(cells1, '.selected'), 'to equal', [cells1[25]]);
|
|
64
|
+
expect(filterCells(cells1, '.range-start'), 'to equal', [cells1[16]]);
|
|
65
|
+
expect(filterCells(cells1, '.range-end'), 'to equal', [cells1[25]]);
|
|
66
|
+
expect(filterCells(cells1, '.range'), 'to equal', cells1.slice(17, 25));
|
|
67
|
+
expect(filterCells(cells1, '.focused'), 'to equal', [cells1[25]]);
|
|
68
|
+
|
|
69
|
+
simulant.fire(input0, 'keydown', {key: 'Escape'});
|
|
70
|
+
input0.value = '';
|
|
71
|
+
simulant.fire(input0, 'keydown', {key: 'Enter'});
|
|
72
|
+
|
|
73
|
+
expect(drp.dates, 'to equal', [undefined, dateValue(2020, 1, 20)]);
|
|
74
|
+
expect(drp.getDates(), 'to equal', [undefined, new Date(drp.dates[1])]);
|
|
75
|
+
expect(input0.value, 'to be', '');
|
|
76
|
+
expect(filterCells(cells0, '.selected'), 'to equal', []);
|
|
77
|
+
expect(filterCells(cells0, '.range-start'), 'to equal', []);
|
|
78
|
+
expect(filterCells(cells0, '.range-end'), 'to equal', [cells0[25]]);
|
|
79
|
+
expect(filterCells(cells0, '.range'), 'to equal', []);
|
|
80
|
+
expect(filterCells(cells0, '.focused'), 'to equal', [cells0[19]]);
|
|
81
|
+
|
|
82
|
+
expect(input1.value, 'to be', '02/20/2020');
|
|
83
|
+
expect(filterCells(cells1, '.selected'), 'to equal', [cells1[25]]);
|
|
84
|
+
expect(filterCells(cells1, '.range-start'), 'to equal', []);
|
|
85
|
+
expect(filterCells(cells1, '.range-end'), 'to equal', [cells1[25]]);
|
|
86
|
+
expect(filterCells(cells1, '.range'), 'to equal', []);
|
|
87
|
+
expect(filterCells(cells1, '.focused'), 'to equal', [cells1[25]]);
|
|
88
|
+
|
|
89
|
+
drp.destroy();
|
|
90
|
+
input0.value = '';
|
|
91
|
+
input1.value = '';
|
|
92
|
+
|
|
93
|
+
// by setDates()
|
|
94
|
+
({drp, picker0, picker1} = createDRP(elem, {allowOneSidedRange: true}));
|
|
95
|
+
cells0 = getCells(picker0);
|
|
96
|
+
cells1 = getCells(picker1);
|
|
97
|
+
|
|
98
|
+
drp.setDates('02/11/2020');
|
|
99
|
+
|
|
100
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 11), undefined]);
|
|
101
|
+
expect(input0.value, 'to be', '02/11/2020');
|
|
102
|
+
expect(filterCells(cells0, '.selected'), 'to equal', [cells0[16]]);
|
|
103
|
+
expect(input1.value, 'to be', '');
|
|
104
|
+
expect(filterCells(cells1, '.selected'), 'to equal', []);
|
|
105
|
+
|
|
106
|
+
drp.setDates(undefined, '02/20/2020');
|
|
107
|
+
|
|
108
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 11), dateValue(2020, 1, 20)]);
|
|
109
|
+
expect(input0.value, 'to be', '02/11/2020');
|
|
110
|
+
expect(filterCells(cells0, '.selected'), 'to equal', [cells0[16]]);
|
|
111
|
+
expect(input1.value, 'to be', '02/20/2020');
|
|
112
|
+
expect(filterCells(cells1, '.selected'), 'to equal', [cells1[25]]);
|
|
113
|
+
|
|
114
|
+
drp.setDates({clear: true});
|
|
115
|
+
|
|
116
|
+
expect(drp.dates, 'to equal', [undefined, dateValue(2020, 1, 20)]);
|
|
117
|
+
expect(input0.value, 'to be', '');
|
|
118
|
+
expect(filterCells(cells0, '.selected'), 'to equal', []);
|
|
119
|
+
expect(input1.value, 'to be', '02/20/2020');
|
|
120
|
+
expect(filterCells(cells1, '.selected'), 'to equal', [cells1[25]]);
|
|
121
|
+
|
|
122
|
+
drp.setDates('02/11/2020', {clear: true});
|
|
123
|
+
|
|
124
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 11), undefined]);
|
|
125
|
+
expect(input0.value, 'to be', '02/11/2020');
|
|
126
|
+
expect(filterCells(cells0, '.selected'), 'to equal', [cells0[16]]);
|
|
127
|
+
expect(input1.value, 'to be', '');
|
|
128
|
+
expect(filterCells(cells1, '.selected'), 'to equal', []);
|
|
129
|
+
|
|
130
|
+
drp.setDates({clear: true}, '02/20/2020');
|
|
131
|
+
|
|
132
|
+
expect(drp.dates, 'to equal', [undefined, dateValue(2020, 1, 20)]);
|
|
133
|
+
expect(input0.value, 'to be', '');
|
|
134
|
+
expect(filterCells(cells0, '.selected'), 'to equal', []);
|
|
135
|
+
expect(input1.value, 'to be', '02/20/2020');
|
|
136
|
+
expect(filterCells(cells1, '.selected'), 'to equal', [cells1[25]]);
|
|
137
|
+
|
|
138
|
+
drp.setDates(undefined, {clear: true});
|
|
139
|
+
|
|
140
|
+
expect(drp.dates, 'to equal', [undefined, undefined]);
|
|
141
|
+
expect(input0.value, 'to be', '');
|
|
142
|
+
expect(filterCells(cells0, '.selected'), 'to equal', []);
|
|
143
|
+
expect(input1.value, 'to be', '');
|
|
144
|
+
expect(filterCells(cells1, '.selected'), 'to equal', []);
|
|
145
|
+
|
|
146
|
+
drp.destroy();
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('can be updated with setOptions()', function () {
|
|
150
|
+
const drp = new DateRangePicker(elem);
|
|
151
|
+
drp.setOptions({allowOneSidedRange: true});
|
|
152
|
+
|
|
153
|
+
input0.value = '02/11/2020';
|
|
154
|
+
simulant.fire(input0, 'keydown', {key: 'Enter'});
|
|
155
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 11), undefined]);
|
|
156
|
+
|
|
157
|
+
drp.setDates({clear: true}, '02/11/2020');
|
|
158
|
+
expect(drp.dates, 'to equal', [undefined, dateValue(2020, 1, 11)]);
|
|
159
|
+
|
|
160
|
+
drp.setOptions({allowOneSidedRange: false});
|
|
161
|
+
|
|
162
|
+
input1.value = '02/20/2020';
|
|
163
|
+
simulant.fire(input1, 'keydown', {key: 'Enter'});
|
|
164
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 20), dateValue(2020, 1, 20)]);
|
|
165
|
+
|
|
166
|
+
drp.setDates({clear: true});
|
|
167
|
+
expect(drp.dates, 'to equal', [undefined, undefined]);
|
|
168
|
+
|
|
169
|
+
drp.destroy();
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
describe('pickLevel', function () {
|
|
174
|
+
it('changes the span of range selection to 1st of a month → last day of a month when 1', function () {
|
|
175
|
+
input0.value = '2/14/2020';
|
|
176
|
+
input1.value = '2/14/2020';
|
|
177
|
+
|
|
178
|
+
const {drp, picker0, picker1} = createDRP(elem, {pickLevel: 1});
|
|
179
|
+
const viewSwitch0 = picker0.querySelector('.view-switch');
|
|
180
|
+
const viewSwitch1 = picker1.querySelector('.view-switch');
|
|
181
|
+
let cells0 = getCells(picker0);
|
|
182
|
+
let cells1 = getCells(picker1);
|
|
183
|
+
|
|
184
|
+
input0.focus();
|
|
185
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 1, 1), dateValue(2020, 1, 29)]);
|
|
186
|
+
expect(input0.value, 'to be', '02/01/2020');
|
|
187
|
+
expect(viewSwitch0.textContent, 'to be', '2020');
|
|
188
|
+
expect(getCellIndices(cells0, '.selected'), 'to equal', [1]);
|
|
189
|
+
expect(getCellIndices(cells0, '.range-start'), 'to equal', [1]);
|
|
190
|
+
expect(getCellIndices(cells0, '.range-end'), 'to equal', [1]);
|
|
191
|
+
expect(getCellIndices(cells0, '.range'), 'to equal', []);
|
|
192
|
+
expect(getCellIndices(cells0, '.focused'), 'to equal', [1]);
|
|
193
|
+
|
|
194
|
+
input1.focus();
|
|
195
|
+
expect(input1.value, 'to be', '02/29/2020');
|
|
196
|
+
expect(viewSwitch1.textContent, 'to be', '2020');
|
|
197
|
+
expect(getCellIndices(cells1, '.selected'), 'to equal', [1]);
|
|
198
|
+
expect(getCellIndices(cells1, '.range-start'), 'to equal', [1]);
|
|
199
|
+
expect(getCellIndices(cells1, '.range-end'), 'to equal', [1]);
|
|
200
|
+
expect(getCellIndices(cells1, '.range'), 'to equal', []);
|
|
201
|
+
expect(getCellIndices(cells1, '.focused'), 'to equal', [1]);
|
|
202
|
+
|
|
203
|
+
// mouse operation
|
|
204
|
+
cells0[0].click();
|
|
205
|
+
cells1[6].click();
|
|
206
|
+
|
|
207
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 0, 1), dateValue(2020, 6, 31)]);
|
|
208
|
+
expect(input0.value, 'to be', '01/01/2020');
|
|
209
|
+
expect(viewSwitch0.textContent, 'to be', '2020');
|
|
210
|
+
expect(getCellIndices(cells0, '.selected'), 'to equal', [0]);
|
|
211
|
+
expect(getCellIndices(cells0, '.range-start'), 'to equal', [0]);
|
|
212
|
+
expect(getCellIndices(cells0, '.range-end'), 'to equal', [6]);
|
|
213
|
+
|
|
214
|
+
input1.focus();
|
|
215
|
+
expect(input1.value, 'to be', '07/31/2020');
|
|
216
|
+
expect(viewSwitch1.textContent, 'to be', '2020');
|
|
217
|
+
expect(getCellIndices(cells1, '.selected'), 'to equal', [6]);
|
|
218
|
+
expect(getCellIndices(cells1, '.range-start'), 'to equal', [0]);
|
|
219
|
+
expect(getCellIndices(cells1, '.range-end'), 'to equal', [6]);
|
|
220
|
+
|
|
221
|
+
// api call
|
|
222
|
+
drp.setDates('2/14/2021', '3/14/2020');
|
|
223
|
+
|
|
224
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 2, 1), dateValue(2021, 1, 28)]);
|
|
225
|
+
expect(input0.value, 'to be', '03/01/2020');
|
|
226
|
+
expect(viewSwitch0.textContent, 'to be', '2020');
|
|
227
|
+
expect(getCellIndices(cells0, '.selected'), 'to equal', [2]);
|
|
228
|
+
expect(getCellIndices(cells0, '.range-start'), 'to equal', [2]);
|
|
229
|
+
expect(getCellIndices(cells0, '.range-end'), 'to equal', []);
|
|
230
|
+
|
|
231
|
+
input1.focus();
|
|
232
|
+
expect(input1.value, 'to be', '02/28/2021');
|
|
233
|
+
expect(viewSwitch1.textContent, 'to be', '2021');
|
|
234
|
+
expect(getCellIndices(cells1, '.selected'), 'to equal', [1]);
|
|
235
|
+
expect(getCellIndices(cells1, '.range-start'), 'to equal', []);
|
|
236
|
+
expect(getCellIndices(cells1, '.range-end'), 'to equal', [1]);
|
|
237
|
+
|
|
238
|
+
drp.destroy();
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
it('changes the span of range selection to Jan 1st of a month → Dec 31st of a month when 2', function () {
|
|
242
|
+
input0.value = '2/14/2020';
|
|
243
|
+
input1.value = '2/14/2020';
|
|
244
|
+
|
|
245
|
+
const {drp, picker0, picker1} = createDRP(elem, {pickLevel: 2});
|
|
246
|
+
const viewSwitch0 = picker0.querySelector('.view-switch');
|
|
247
|
+
const viewSwitch1 = picker1.querySelector('.view-switch');
|
|
248
|
+
let cells0 = getCells(picker0);
|
|
249
|
+
let cells1 = getCells(picker1);
|
|
250
|
+
|
|
251
|
+
input0.focus();
|
|
252
|
+
expect(drp.dates, 'to equal', [dateValue(2020, 0, 1), dateValue(2020, 11, 31)]);
|
|
253
|
+
expect(input0.value, 'to be', '01/01/2020');
|
|
254
|
+
expect(viewSwitch0.textContent, 'to be', '2020-2029');
|
|
255
|
+
expect(getCellIndices(cells0, '.selected'), 'to equal', [1]);
|
|
256
|
+
expect(getCellIndices(cells0, '.range-start'), 'to equal', [1]);
|
|
257
|
+
expect(getCellIndices(cells0, '.range-end'), 'to equal', [1]);
|
|
258
|
+
expect(getCellIndices(cells0, '.range'), 'to equal', []);
|
|
259
|
+
expect(getCellIndices(cells0, '.focused'), 'to equal', [1]);
|
|
260
|
+
|
|
261
|
+
input1.focus();
|
|
262
|
+
expect(input1.value, 'to be', '12/31/2020');
|
|
263
|
+
expect(viewSwitch1.textContent, 'to be', '2020-2029');
|
|
264
|
+
expect(getCellIndices(cells1, '.selected'), 'to equal', [1]);
|
|
265
|
+
expect(getCellIndices(cells1, '.range-start'), 'to equal', [1]);
|
|
266
|
+
expect(getCellIndices(cells1, '.range-end'), 'to equal', [1]);
|
|
267
|
+
expect(getCellIndices(cells1, '.range'), 'to equal', []);
|
|
268
|
+
expect(getCellIndices(cells1, '.focused'), 'to equal', [1]);
|
|
269
|
+
|
|
270
|
+
// mouse operation
|
|
271
|
+
cells0[0].click();
|
|
272
|
+
cells1[3].click();
|
|
273
|
+
|
|
274
|
+
expect(drp.dates, 'to equal', [dateValue(2019, 0, 1), dateValue(2022, 11, 31)]);
|
|
275
|
+
expect(input0.value, 'to be', '01/01/2019');
|
|
276
|
+
expect(viewSwitch0.textContent, 'to be', '2010-2019');
|
|
277
|
+
expect(getCellIndices(cells0, '.selected'), 'to equal', [10]);
|
|
278
|
+
expect(getCellIndices(cells0, '.range-start'), 'to equal', [10]);
|
|
279
|
+
expect(getCellIndices(cells0, '.range-end'), 'to equal', []);
|
|
280
|
+
|
|
281
|
+
input1.focus();
|
|
282
|
+
expect(input1.value, 'to be', '12/31/2022');
|
|
283
|
+
expect(viewSwitch1.textContent, 'to be', '2020-2029');
|
|
284
|
+
expect(getCellIndices(cells1, '.selected'), 'to equal', [3]);
|
|
285
|
+
expect(getCellIndices(cells1, '.range-start'), 'to equal', [0]);
|
|
286
|
+
expect(getCellIndices(cells1, '.range-end'), 'to equal', [3]);
|
|
287
|
+
|
|
288
|
+
// api call
|
|
289
|
+
drp.setDates('2/14/2025', '3/14/2021');
|
|
290
|
+
|
|
291
|
+
expect(drp.dates, 'to equal', [dateValue(2021, 0, 1), dateValue(2025, 11, 31)]);
|
|
292
|
+
expect(input0.value, 'to be', '01/01/2021');
|
|
293
|
+
expect(viewSwitch0.textContent, 'to be', '2020-2029');
|
|
294
|
+
expect(getCellIndices(cells0, '.selected'), 'to equal', [2]);
|
|
295
|
+
expect(getCellIndices(cells0, '.range-start'), 'to equal', [2]);
|
|
296
|
+
expect(getCellIndices(cells0, '.range-end'), 'to equal', [6]);
|
|
297
|
+
|
|
298
|
+
input1.focus();
|
|
299
|
+
expect(input1.value, 'to be', '12/31/2025');
|
|
300
|
+
expect(viewSwitch1.textContent, 'to be', '2020-2029');
|
|
301
|
+
expect(getCellIndices(cells1, '.selected'), 'to equal', [6]);
|
|
302
|
+
expect(getCellIndices(cells1, '.range-start'), 'to equal', [2]);
|
|
303
|
+
expect(getCellIndices(cells1, '.range-end'), 'to equal', [6]);
|
|
304
|
+
|
|
305
|
+
drp.destroy();
|
|
306
|
+
});
|
|
307
|
+
});
|
|
308
|
+
});
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
describe('Datepicker', function () {
|
|
2
|
+
let input;
|
|
3
|
+
|
|
4
|
+
before(function () {
|
|
5
|
+
input = document.createElement('input');
|
|
6
|
+
testContainer.appendChild(input);
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
after(function () {
|
|
10
|
+
testContainer.removeChild(input);
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('input element\'s value is used for the initial date', function () {
|
|
14
|
+
input.value = '04/22/2020';
|
|
15
|
+
|
|
16
|
+
const dp = new Datepicker(input);
|
|
17
|
+
expect(dp.dates, 'to equal', [dateValue(2020, 3, 22)]);
|
|
18
|
+
|
|
19
|
+
dp.destroy();
|
|
20
|
+
input.value = '';
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('the picker is hidden at start', function () {
|
|
24
|
+
const dp = new Datepicker(input);
|
|
25
|
+
expect(isVisible(document.querySelector('.datepicker')), 'to be false');
|
|
26
|
+
expect(dp.active, 'to be false');
|
|
27
|
+
dp.destroy();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
it('the picker becomes visible when the input element get focused', function () {
|
|
31
|
+
const dp = new Datepicker(input);
|
|
32
|
+
input.focus();
|
|
33
|
+
|
|
34
|
+
expect(isVisible(document.querySelector('.datepicker')), 'to be true');
|
|
35
|
+
expect(dp.active, 'to be true');
|
|
36
|
+
dp.destroy();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
describe('hide()', function () {
|
|
40
|
+
it('makes the picker invisible', function () {
|
|
41
|
+
const dp = new Datepicker(input);
|
|
42
|
+
input.focus();
|
|
43
|
+
dp.hide();
|
|
44
|
+
|
|
45
|
+
expect(isVisible(document.querySelector('.datepicker')), 'to be false');
|
|
46
|
+
expect(dp.active, 'to be false');
|
|
47
|
+
|
|
48
|
+
dp.destroy();
|
|
49
|
+
});
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe('show()', function () {
|
|
53
|
+
it('makes the picker visible', function () {
|
|
54
|
+
const dp = new Datepicker(input);
|
|
55
|
+
dp.show();
|
|
56
|
+
|
|
57
|
+
expect(isVisible(document.querySelector('.datepicker')), 'to be true');
|
|
58
|
+
expect(dp.active, 'to be true');
|
|
59
|
+
|
|
60
|
+
dp.destroy();
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('moves the focus onto the input field', function () {
|
|
64
|
+
// related to issue #52
|
|
65
|
+
const dp = new Datepicker(input);
|
|
66
|
+
const spyShow = sinon.spy(dp, 'show');
|
|
67
|
+
input.blur();
|
|
68
|
+
dp.show();
|
|
69
|
+
|
|
70
|
+
expect(document.activeElement, 'to be', input);
|
|
71
|
+
// the focus listener's calling show() is prevented
|
|
72
|
+
expect(spyShow.calledOnce, 'to be true');
|
|
73
|
+
|
|
74
|
+
spyShow.restore();
|
|
75
|
+
dp.destroy();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('adds or removes dir attribute to/from the picker if picker\'s text direction != input\'s', function (done) {
|
|
79
|
+
testContainer.dir = 'rtl';
|
|
80
|
+
|
|
81
|
+
const {dp, picker} = createDP(input);
|
|
82
|
+
dp.show();
|
|
83
|
+
expect(picker.dir, 'to be', 'rtl');
|
|
84
|
+
|
|
85
|
+
dp.hide();
|
|
86
|
+
testContainer.removeAttribute('dir');
|
|
87
|
+
|
|
88
|
+
dp.show();
|
|
89
|
+
expect(picker.hasAttribute('dir'), 'to be false');
|
|
90
|
+
|
|
91
|
+
dp.hide();
|
|
92
|
+
|
|
93
|
+
const htmlElem = document.querySelector('html');
|
|
94
|
+
htmlElem.dir = 'rtl';
|
|
95
|
+
input.style.direction = 'ltr';
|
|
96
|
+
|
|
97
|
+
dp.show();
|
|
98
|
+
expect(picker.dir, 'to be', 'ltr');
|
|
99
|
+
|
|
100
|
+
dp.hide();
|
|
101
|
+
input.removeAttribute('style');
|
|
102
|
+
|
|
103
|
+
dp.show();
|
|
104
|
+
expect(picker.hasAttribute('dir'), 'to be false');
|
|
105
|
+
|
|
106
|
+
dp.destroy();
|
|
107
|
+
htmlElem.removeAttribute('dir');
|
|
108
|
+
htmlElem.style.direction = 'ltr';
|
|
109
|
+
|
|
110
|
+
const checkDirChange = () => {
|
|
111
|
+
if (window.getComputedStyle(htmlElem).direction === 'ltr') {
|
|
112
|
+
htmlElem.removeAttribute('style');
|
|
113
|
+
done();
|
|
114
|
+
} else {
|
|
115
|
+
setTimeout(checkDirChange, 10);
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
checkDirChange();
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('picker', function () {
|
|
123
|
+
it('displays current month with current date as focued date if no initial date is provided', function () {
|
|
124
|
+
let clock = sinon.useFakeTimers({now: new Date(2020, 1, 14)});
|
|
125
|
+
|
|
126
|
+
const {dp, picker} = createDP(input);
|
|
127
|
+
const days = Array.from(picker.querySelector('.datepicker-grid').children);
|
|
128
|
+
dp.show();
|
|
129
|
+
|
|
130
|
+
expect(getViewSwitch(picker).textContent, 'to be', 'February 2020');
|
|
131
|
+
|
|
132
|
+
expect(days, 'to have length', 42);
|
|
133
|
+
expect(filterCells(days, '.datepicker-cell'), 'to have length', 42);
|
|
134
|
+
expect(days[0].textContent, 'to be', '26');
|
|
135
|
+
expect(days[0].classList.contains('prev'), 'to be true');
|
|
136
|
+
expect(days[0].classList.contains('next'), 'to be false');
|
|
137
|
+
expect(days[5].textContent, 'to be', '31');
|
|
138
|
+
expect(days[5].classList.contains('prev'), 'to be true');
|
|
139
|
+
expect(days[5].classList.contains('next'), 'to be false');
|
|
140
|
+
expect(days[6].textContent, 'to be', '1');
|
|
141
|
+
expect(days[6].classList.contains('prev'), 'to be false');
|
|
142
|
+
expect(days[6].classList.contains('next'), 'to be false');
|
|
143
|
+
expect(days[34].textContent, 'to be', '29');
|
|
144
|
+
expect(days[34].classList.contains('prev'), 'to be false');
|
|
145
|
+
expect(days[34].classList.contains('next'), 'to be false');
|
|
146
|
+
expect(days[35].textContent, 'to be', '1');
|
|
147
|
+
expect(days[35].classList.contains('prev'), 'to be false');
|
|
148
|
+
expect(days[35].classList.contains('next'), 'to be true');
|
|
149
|
+
expect(days[41].textContent, 'to be', '7');
|
|
150
|
+
expect(days[41].classList.contains('prev'), 'to be false');
|
|
151
|
+
expect(days[41].classList.contains('next'), 'to be true');
|
|
152
|
+
|
|
153
|
+
expect(filterCells(days, '.focused'), 'to equal', [days[19]]);
|
|
154
|
+
expect(filterCells(days, '.selected'), 'to be empty');
|
|
155
|
+
expect(days[19].textContent, 'to be', '14');
|
|
156
|
+
|
|
157
|
+
dp.destroy();
|
|
158
|
+
clock.restore();
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('displays iniial date\'s month with the date as selected and focued date', function () {
|
|
162
|
+
input.value = '04/22/2020';
|
|
163
|
+
|
|
164
|
+
const {dp, picker} = createDP(input);
|
|
165
|
+
const days = Array.from(picker.querySelector('.datepicker-grid').children);
|
|
166
|
+
dp.show();
|
|
167
|
+
|
|
168
|
+
expect(getViewSwitch(picker).textContent, 'to be', 'April 2020');
|
|
169
|
+
|
|
170
|
+
expect(days, 'to have length', 42);
|
|
171
|
+
expect(filterCells(days, '.datepicker-cell'), 'to have length', 42);
|
|
172
|
+
expect(days[0].textContent, 'to be', '29');
|
|
173
|
+
expect(days[0].classList.contains('prev'), 'to be true');
|
|
174
|
+
expect(days[0].classList.contains('next'), 'to be false');
|
|
175
|
+
expect(days[2].textContent, 'to be', '31');
|
|
176
|
+
expect(days[2].classList.contains('prev'), 'to be true');
|
|
177
|
+
expect(days[2].classList.contains('next'), 'to be false');
|
|
178
|
+
expect(days[3].textContent, 'to be', '1');
|
|
179
|
+
expect(days[3].classList.contains('prev'), 'to be false');
|
|
180
|
+
expect(days[3].classList.contains('next'), 'to be false');
|
|
181
|
+
expect(days[32].textContent, 'to be', '30');
|
|
182
|
+
expect(days[32].classList.contains('prev'), 'to be false');
|
|
183
|
+
expect(days[32].classList.contains('next'), 'to be false');
|
|
184
|
+
expect(days[33].textContent, 'to be', '1');
|
|
185
|
+
expect(days[33].classList.contains('prev'), 'to be false');
|
|
186
|
+
expect(days[33].classList.contains('next'), 'to be true');
|
|
187
|
+
expect(days[41].textContent, 'to be', '9');
|
|
188
|
+
expect(days[41].classList.contains('prev'), 'to be false');
|
|
189
|
+
expect(days[41].classList.contains('next'), 'to be true');
|
|
190
|
+
|
|
191
|
+
expect(filterCells(days, '.focused'), 'to equal', [days[24]]);
|
|
192
|
+
expect(filterCells(days, '.selected'), 'to equal', [days[24]]);
|
|
193
|
+
expect(days[24].textContent, 'to be', '22');
|
|
194
|
+
|
|
195
|
+
dp.destroy();
|
|
196
|
+
input.value = '';
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it('displays day names of week by default', function () {
|
|
200
|
+
const {dp, picker} = createDP(input);
|
|
201
|
+
const daysOfWeek = picker.querySelector('.days-of-week');
|
|
202
|
+
const days = Array.from(daysOfWeek.children).map(el => el.textContent);
|
|
203
|
+
|
|
204
|
+
expect(days, 'to equal', ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa']);
|
|
205
|
+
|
|
206
|
+
dp.destroy();
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('does not display calendar weeks by default', function () {
|
|
210
|
+
const {dp, picker} = createDP(input);
|
|
211
|
+
|
|
212
|
+
expect(picker.querySelectorAll('.calendar-weeks').length, 'to be', 0);
|
|
213
|
+
|
|
214
|
+
dp.destroy();
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it('uses "button" for the main class of button element', function () {
|
|
218
|
+
const {dp, picker} = createDP(input);
|
|
219
|
+
const [viewSwitch, prevBtn, nextBtn, todayBtn, clearBtn] = getParts(picker, [
|
|
220
|
+
'.view-switch',
|
|
221
|
+
'.prev-btn',
|
|
222
|
+
'.next-btn',
|
|
223
|
+
'.today-btn',
|
|
224
|
+
'.clear-btn',
|
|
225
|
+
]);
|
|
226
|
+
|
|
227
|
+
expect(viewSwitch.className, 'to be', 'button view-switch');
|
|
228
|
+
expect(prevBtn.className, 'to be', 'button prev-btn');
|
|
229
|
+
expect(nextBtn.className, 'to be', 'button next-btn');
|
|
230
|
+
expect(todayBtn.className, 'to be', 'button today-btn');
|
|
231
|
+
expect(clearBtn.className, 'to be', 'button clear-btn');
|
|
232
|
+
|
|
233
|
+
dp.destroy();
|
|
234
|
+
});
|
|
235
|
+
});
|
|
236
|
+
});
|