primevue-mirror/components/badge/Badge.spec.js

36 lines
1005 B
JavaScript

import { mount } from '@vue/test-utils';
import { expect } from 'vitest';
import Badge from './Badge.vue';
let wrapper = null;
describe('Badge.vue', () => {
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', () => {
wrapper = mount(Badge, {
slots: {
default: 'Main Content'
}
});
expect(wrapper.vm.containerClass).toBe('p-overlay-badge');
});
});