primevue-mirror/components/lib/badgedirective/BadgeDirective.spec.js

18 lines
616 B
JavaScript
Raw Normal View History

2022-09-06 12:03:37 +00:00
import { mount } from '@vue/test-utils';
import BadgeDirective from './BadgeDirective';
describe('directive badge should exist', () => {
it('positioned badge', () => {
const wrapper = mount({
2024-05-13 14:02:20 +00:00
template: '<i class="pi pi-bell mr-4" style="font-size: 2rem" v-badge="2"></i>',
2022-09-06 12:03:37 +00:00
directives: {
2022-09-14 11:26:01 +00:00
badge: BadgeDirective
2022-09-06 12:03:37 +00:00
}
});
expect(wrapper.find('.p-overlay-badge').exists()).toBe(true);
expect(wrapper.find('.p-badge.p-component').exists()).toBe(true);
expect(wrapper.find('.p-badge.p-component').text()).toBe('2');
});
2022-09-14 11:26:01 +00:00
});