mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 08:52:34 +00:00
Styles imported. Components added
This commit is contained in:
parent
3cb3910561
commit
8264983db4
452 changed files with 55902 additions and 0 deletions
38
components/inputmask/InputMask.spec.js
Normal file
38
components/inputmask/InputMask.spec.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import InputMask from './InputMask.vue';
|
||||
|
||||
describe('InputMask.vue', () => {
|
||||
it('should exist', async () => {
|
||||
const wrapper = mount(InputMask, {
|
||||
props: {
|
||||
modelValue: null,
|
||||
mask: '99-999999',
|
||||
placeholder: '99-999999'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper.find('.p-inputmask.p-component').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-inputmask.p-component').attributes().placeholder).toBe('99-999999');
|
||||
|
||||
const event = {'target': { 'value': '1' }};
|
||||
|
||||
await wrapper.vm.onInput(event);
|
||||
|
||||
expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['1']);
|
||||
});
|
||||
|
||||
it('keydown event', async () => {
|
||||
const wrapper = mount(InputMask, {
|
||||
props: {
|
||||
modelValue: null,
|
||||
mask: '99/99/9999'
|
||||
}
|
||||
});
|
||||
|
||||
const event = {'target': { 'value': '1' }};
|
||||
|
||||
await wrapper.vm.onKeyDown(event);
|
||||
|
||||
expect(wrapper.emitted().keydown[0]).toEqual([event]);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue