Merge branch 'develop' into feat/333-creation-text-input
This commit is contained in:
23
app/components/malio/Input.test.ts
Normal file
23
app/components/malio/Input.test.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import Input from './Input.vue'
|
||||
|
||||
describe('MalioInput', () => {
|
||||
it('affiche la valeur initiale', () => {
|
||||
const wrapper = mount(Input, {
|
||||
props: { modelValue: 'hello' },
|
||||
})
|
||||
|
||||
expect(wrapper.get('input').element.value).toBe('hello')
|
||||
})
|
||||
|
||||
it('emet update:modelValue au changement', async () => {
|
||||
const wrapper = mount(Input, {
|
||||
props: { modelValue: '' },
|
||||
})
|
||||
|
||||
await wrapper.get('input').setValue('new value')
|
||||
|
||||
expect(wrapper.emitted('update:modelValue')?.[0]).toEqual(['new value'])
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user