From 8e5031b314c0d45d65dda73d6e8ae2dd063805de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bahad=C4=B1r=20Sofuo=C4=9Flu?= Date: Thu, 29 Dec 2022 11:26:54 +0300 Subject: [PATCH] Badge unit test update --- components/badge/Badge.spec.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/components/badge/Badge.spec.js b/components/badge/Badge.spec.js index 95d0c99f4..ae92fdecc 100644 --- a/components/badge/Badge.spec.js +++ b/components/badge/Badge.spec.js @@ -1,33 +1,35 @@ import { mount } from '@vue/test-utils'; -import Button from 'primevue/button'; +import { expect } from 'vitest'; import Badge from './Badge.vue'; +let wrapper = null; + describe('Badge.vue', () => { - it('should exist', () => { - const wrapper = mount(Badge, { + beforeEach(() => { + wrapper = mount(Badge, { props: { value: '29', severity: 'warning', size: 'large' } }); - + }); + it('should exist', () => { expect(wrapper.find('.p-badge.p-component').exists()).toBe(true); expect(wrapper.find('.p-badge-warning').exists()).toBe(true); expect(wrapper.find('.p-badge-lg').exists()).toBe(true); expect(wrapper.find('.p-badge-no-gutter').exists()).toBe(false); + + expect(wrapper.vm.containerClass).not.toBe('p-overlay-badge'); }); it('badge classes should exist', () => { - const wrapper = mount({ - template: '