-
Notifications
You must be signed in to change notification settings - Fork 1
/
DropdownMenuItem.test.ts
64 lines (52 loc) · 1.56 KB
/
DropdownMenuItem.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {describe, expect, it} from 'vitest';
import DropdownMenuItem from '@/components/DropdownMenuItem';
import {shallowMount} from '@vue/test-utils';
describe('template', () => {
componentSlotRenderTest(DropdownMenuItem);
componentRenderTest(DropdownMenuItem, {props: {href: 'https://github.com/owowagency/bootstrap-vue'}});
componentRenderTest(DropdownMenuItem, {props: {is: 'div'}});
componentRenderTest(DropdownMenuItem, {props: {to: {name: 'home'}}});
componentSlotRenderTest(
DropdownMenuItem,
'default',
{props: {header: true}},
);
componentRenderTest(
DropdownMenuItem,
{props: {label: 'Hello'}},
true,
'renders label',
);
componentRenderTest(
DropdownMenuItem,
{props: {active: true, label: 'there'}},
true,
'renders active',
);
componentRenderTest(
DropdownMenuItem,
{props: {disabled: true, label: 'there'}},
true,
'renders disabled',
);
componentRenderTest(
DropdownMenuItem,
{props: {divider: true}},
true,
'renders divider',
);
componentRenderTest(
DropdownMenuItem,
{props: {header: true, label: 'general kenobi'}},
true,
'renders header',
);
it('adds item class to link', () => {
const wrapper = shallowMount(DropdownMenuItem, {
props: {
itemClass: ['hello-there'],
},
});
expect(wrapper.find('a').classes()).toContain('hello-there');
});
});