mirror of
https://github.com/tenrok/maska.git
synced 2026-06-17 19:21:21 +03:00
Directive could be applied to parent of input element
This commit is contained in:
@@ -12,6 +12,7 @@ import Dynamic from './components/Dynamic.vue'
|
||||
import Events from './components/Events.vue'
|
||||
import Hooks from './components/Hooks.vue'
|
||||
import Options from './components/Options.vue'
|
||||
import Parent from './components/Parent.vue'
|
||||
import Simple from './components/Simple.vue'
|
||||
|
||||
test('simple directive', async () => {
|
||||
@@ -34,6 +35,17 @@ test('data-attr', async () => {
|
||||
expect(input.element.value).toBe('1-2')
|
||||
})
|
||||
|
||||
test('parent element', async () => {
|
||||
const wrapper = mount(Parent)
|
||||
const input = wrapper.get('input')
|
||||
|
||||
await input.setValue('1')
|
||||
expect(input.element.value).toBe('1-')
|
||||
|
||||
await input.setValue('123')
|
||||
expect(input.element.value).toBe('1-2')
|
||||
})
|
||||
|
||||
test('dynamic mask', async () => {
|
||||
const wrapper = mount(Dynamic)
|
||||
const input = wrapper.get('input')
|
||||
|
||||
Reference in New Issue
Block a user