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/avatar/Avatar.spec.js
Normal file
35
components/lib/avatar/Avatar.spec.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
import { mount } from '@vue/test-utils';
|
||||
import { beforeEach } from 'vitest';
|
||||
import Avatar from './Avatar.vue';
|
||||
let wrapper = null;
|
||||
|
||||
beforeEach(() => {
|
||||
wrapper = mount(Avatar, {
|
||||
props: {
|
||||
label: 'T',
|
||||
size: 'large',
|
||||
shape: 'circle',
|
||||
image: 'test'
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('Avatar.vue', () => {
|
||||
it('should exist', () => {
|
||||
expect(wrapper.find('.p-avatar.p-component').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-avatar-lg').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-avatar-circle').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-avatar-text').exists()).toBe(true);
|
||||
expect(wrapper.find('.p-avatar-text').text()).toBe('T');
|
||||
});
|
||||
|
||||
it('should exist', async () => {
|
||||
await wrapper.setProps({ image: 'imageTest' });
|
||||
const image = wrapper.find('.p-avatar-image');
|
||||
|
||||
await wrapper.vm.onError();
|
||||
|
||||
expect(image.exists()).toBe(true);
|
||||
expect(wrapper.emitted().error.length).toBe(1);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue