Avatar test added

pull/2305/head
Tuğçe Küçükoğlu 2022-03-10 12:17:17 +03:00 committed by Tuğçe Küçükoğlu
parent b2b8c06df5
commit 4cfebab5d9
2 changed files with 41 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import { mount } from '@vue/test-utils';
import Avatar from './Avatar.vue';
describe('Avatar.vue', () => {
it('should exist', () => {
const wrapper = mount(Avatar, {
props: {
label: 'T',
size: 'large',
shape: 'circle'
}
});
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');
});
});

View File

@ -0,0 +1,21 @@
import { mount } from '@vue/test-utils';
import AvatarGroup from './AvatarGroup.vue';
import Avatar from '@/components/avatar/Avatar.vue';
describe('AvatarGroup.vue', () => {
it('should exist', () => {
const wrapper = mount(AvatarGroup, {
global: {
components: {
Avatar
}
},
slots: {
default: '<Avatar icon="pi pi-user" size="xlarge" shape="circle" />'
}
});
expect(wrapper.find('.p-avatar-group.p-component').exists()).toBe(true);
expect(wrapper.find('.p-avatar.p-component').exists()).toBe(true);
});
});