Skip to content

Commit 4a57253

Browse files
committed
test(dti): add test for incomplete mask filled scenario
1 parent 38f25e4 commit 4a57253

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/components/date-time-input/date-time-input.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,24 @@ describe('Date Time Input component', () => {
175175
expect(input.value).to.equal('22-07-2024');
176176
});
177177

178+
it('should emit igcChange on blur after an incomplete mask has been parsed - issue #1695', async () => {
179+
const eventSpy = spy(el, 'emitEvent');
180+
el.focus();
181+
await elementUpdated(el);
182+
183+
simulateInput(input, {
184+
value: '0',
185+
inputType: 'insertText',
186+
});
187+
await elementUpdated(el);
188+
189+
el.blur();
190+
await elementUpdated(el);
191+
192+
expect(eventSpy).calledWith('igcChange');
193+
expect(input.value).to.deep.equal('01/01/2000');
194+
});
195+
178196
it('should correctly switch between different pre-defined date formats', async () => {
179197
const targetDate = new Date(2020, 2, 3, 0, 0, 0, 0);
180198

0 commit comments

Comments
 (0)