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
44
components/lib/textarea/Textarea.spec.js
Normal file
44
components/lib/textarea/Textarea.spec.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import Textarea from './Textarea.vue';
|
||||
|
||||
describe('Textarea.vue', () => {
|
||||
let wrapper;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = mount(Textarea, {
|
||||
props: {
|
||||
modelValue: '',
|
||||
rows: 1,
|
||||
cols: 1
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it('should exist', () => {
|
||||
expect(wrapper.find('.p-inputtextarea.p-component').exists()).toBe(true);
|
||||
expect(wrapper.attributes().rows).toBe('1');
|
||||
expect(wrapper.attributes().cols).toBe('1');
|
||||
});
|
||||
|
||||
it('should be autoresized', async () => {
|
||||
await wrapper.setProps({ autoResize: true });
|
||||
|
||||
expect(wrapper.find('.p-inputtextarea-resizable').exists()).toBe(true);
|
||||
});
|
||||
|
||||
it('should input', async () => {
|
||||
await wrapper.vm.onInput({ target: { value: 'primevue' } });
|
||||
|
||||
expect(wrapper.emitted()['update:modelValue'][0]).toEqual(['primevue']);
|
||||
});
|
||||
|
||||
it('should resize', async () => {
|
||||
const firstHeight = wrapper.attributes().style;
|
||||
|
||||
await wrapper.setProps({ autoResize: true });
|
||||
|
||||
await wrapper.vm.onInput({ target: { value: 'primevue' } });
|
||||
|
||||
expect(wrapper.attributes().style).not.toEqual(firstHeight);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue