Skip to content

Commit 6cd5124

Browse files
committed
refactor(unit): Remove workaround for .trigger("focus") in vue 3
1 parent 0350560 commit 6cd5124

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

test/unit/specs/DateInput/DateInput.spec.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ describe('DateInput shallowMounted with showCalendarOnFocus', () => {
173173
it('emits `open` event on focus', async () => {
174174
const input = wrapper.find('input')
175175

176-
// See https://github.com/vuejs/vue-test-utils/issues/1932
177-
// await input.trigger('focus')
178-
await input.element.dispatchEvent(new Event('focus'))
176+
await input.trigger('focus')
179177

180178
expect(wrapper.emitted('open')).toBeTruthy()
181179
})
@@ -197,9 +195,7 @@ describe('DateInput shallowMounted with showCalendarOnFocus', () => {
197195
const input = wrapper.find('input')
198196
const calendarButton = wrapper.find('button[data-test-calendar-button]')
199197

200-
// See https://github.com/vuejs/vue-test-utils/issues/1932
201-
// await input.trigger('focus')
202-
await input.element.dispatchEvent(new Event('focus'))
198+
await input.trigger('focus')
203199
expect(wrapper.emitted('open')).toBeTruthy()
204200

205201
await input.trigger('blur')

test/unit/specs/DateInput/typedDates.spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,7 @@ describe('Datepicker mounted with showCalendarOnFocus', () => {
315315
const input = wrapper.find('input')
316316
const calendarButton = wrapper.find('button[data-test-calendar-button]')
317317

318-
// See https://github.com/vuejs/vue-test-utils/issues/1932
319-
// await input.trigger('focus')
320-
await input.element.dispatchEvent(new Event('focus'))
318+
await input.trigger('focus')
321319
expect(wrapper.vm.isOpen).toBeTruthy()
322320

323321
await calendarButton.trigger('click')

test/unit/specs/Datepicker/Datepicker.spec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,7 @@ describe('Datepicker mounted with showCalendarOnFocus', () => {
433433
it('opens on focusing the input', async () => {
434434
const input = wrapper.find('input')
435435

436-
// See https://github.com/vuejs/vue-test-utils/issues/1932
437-
// await input.trigger('focus')
438-
await input.element.dispatchEvent(new Event('focus'))
436+
await input.trigger('focus')
439437

440438
expect(wrapper.vm.isOpen).toBeTruthy()
441439
})

0 commit comments

Comments
 (0)