mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-09 00:42:36 +00:00
Fixed #3802 - Improve folder structure for nuxt configurations
This commit is contained in:
parent
851950270b
commit
f5fe822afb
563 changed files with 1703 additions and 1095 deletions
35
components/lib/inputtext/InputText.spec.js
Normal file
35
components/lib/inputtext/InputText.spec.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import InputText from './InputText.vue';
|
||||
|
||||
describe('InputText.vue', () => {
|
||||
it('is InputText component exists', async () => {
|
||||
const wrapper = mount(InputText);
|
||||
|
||||
expect(wrapper.find('.p-inputtext.p-component').exists()).toBe(true);
|
||||
|
||||
await wrapper.setProps({ modelValue: 'PrimeVue' });
|
||||
|
||||
expect(wrapper.find('.p-filled').exists()).toBe(true);
|
||||
|
||||
const input = wrapper.find('input');
|
||||
|
||||
expect(input.element.value).toEqual('PrimeVue');
|
||||
});
|
||||
|
||||
it('input event', async () => {
|
||||
const wrapper = mount(InputText);
|
||||
const event = { target: { value: 'a' } };
|
||||
|
||||
await wrapper.vm.onInput(event);
|
||||
|
||||
expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['a']);
|
||||
});
|
||||
|
||||
it('should filled work', async () => {
|
||||
const wrapper = mount(InputText);
|
||||
|
||||
await wrapper.setProps({ modelValue: 'a' });
|
||||
|
||||
expect(wrapper.vm.filled).toBe(true);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue