From 4cfebab5d9a5dd78f5de2bc585c23ce220af70f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 10 Mar 2022 12:17:17 +0300 Subject: [PATCH] Avatar test added --- src/components/avatar/Avatar.spec.js | 20 ++++++++++++++++++ .../avatargroup/AvatarGroup.spec.js | 21 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/components/avatar/Avatar.spec.js create mode 100644 src/components/avatargroup/AvatarGroup.spec.js diff --git a/src/components/avatar/Avatar.spec.js b/src/components/avatar/Avatar.spec.js new file mode 100644 index 000000000..896df5da5 --- /dev/null +++ b/src/components/avatar/Avatar.spec.js @@ -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'); + }); +}); \ No newline at end of file diff --git a/src/components/avatargroup/AvatarGroup.spec.js b/src/components/avatargroup/AvatarGroup.spec.js new file mode 100644 index 000000000..4f0e69de0 --- /dev/null +++ b/src/components/avatargroup/AvatarGroup.spec.js @@ -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: '' + } + }); + + expect(wrapper.find('.p-avatar-group.p-component').exists()).toBe(true); + expect(wrapper.find('.p-avatar.p-component').exists()).toBe(true); + }); +}); \ No newline at end of file