Skip to content

Commit 9ee7649

Browse files
committed
feat(Pickers/DisplayPlugin) fix failing spectest
1 parent 50b6a1c commit 9ee7649

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/datepicker/datepickerSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,14 @@ describe('Datepicker Plugin', () => {
136136
setTimeout(() => {
137137
expect(input.value)
138138
.withContext('value should change with confirm interaction')
139-
.toEqual(`${month < 10 ? `0${month}` : month}/0${day}/${year}`);
139+
.toEqual(`${month < 10 ? `0${month}` : month}/${day < 10 ? '0' + day : day}/${year}`);
140140
dayEl = document.querySelector('.datepicker-container button[data-day="1"]');
141141
dayEl.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
142142
cancelBtn.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
143143
setTimeout(() => {
144144
expect(input.value)
145145
.withContext('value should not change with cancel interaction')
146-
.toEqual(`${month < 10 ? `0${month}` : month}/0${day}/${year}`);
146+
.toEqual(`${month < 10 ? `0${month}` : month}/${day < 10 ? '0' + day : day}/${year}`);
147147
clearBtn.dispatchEvent(new MouseEvent('click', { bubbles: true, cancelable: true }));
148148
setTimeout(() => {
149149
expect(input.value.length)
@@ -156,7 +156,7 @@ describe('Datepicker Plugin', () => {
156156
}, 10);
157157
}, 10);
158158
}, 10);
159-
});
159+
}, 10);
160160
});
161161
});
162162
});

0 commit comments

Comments
 (0)