mirror of
https://github.com/primefaces/primevue.git
synced 2025-05-08 16:37:15 +00:00
Styles imported. Components added
This commit is contained in:
parent
3cb3910561
commit
8264983db4
452 changed files with 55902 additions and 0 deletions
34
components/inputtext/InputText.spec.js
Normal file
34
components/inputtext/InputText.spec.js
Normal file
|
@ -0,0 +1,34 @@
|
|||
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