mirror of
https://github.com/tenrok/maska.git
synced 2026-06-11 18:02:27 +03:00
Make directive change async for correct eager mode
Fix #133 where eager mask used with v-model
This commit is contained in:
@@ -138,17 +138,20 @@ test('custom component', async () => {
|
||||
expect(wrapper.get('div').element.textContent).toBe('1-2')
|
||||
})
|
||||
|
||||
// TODO: find a way to test keyboard input, like backspace after input '567'
|
||||
test('change value', async () => {
|
||||
const wrapper = mount(ChangeValue)
|
||||
const input = wrapper.get('input')
|
||||
|
||||
await new Promise((r) => setTimeout(r))
|
||||
|
||||
expect(input.element.value).toBe('1-2')
|
||||
expect(input.element.value).toBe('12-3')
|
||||
|
||||
await wrapper.get('button').trigger('click')
|
||||
|
||||
expect(input.element.value).toBe('3-4')
|
||||
await new Promise((r) => setTimeout(r))
|
||||
|
||||
expect(input.element.value).toBe('56-7')
|
||||
})
|
||||
|
||||
test('multiple inputs', async () => {
|
||||
|
||||
Reference in New Issue
Block a user