forked from EnergySage/es-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEsFormMsg.spec.js
37 lines (32 loc) · 1.05 KB
/
EsFormMsg.spec.js
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
import { mount } from '@vue/test-utils';
import EsFormMsg from '@/src/lib-components/EsFormMsg.vue';
describe('EsFormMsg', () => {
const variantOptions = ['danger', 'success', 'primary'];
const slots = {
default: 'Main Content',
};
variantOptions.forEach((variant) => {
test(`<EsFormMsg variant="${variant}" show="true" />`, async () => {
const wrapper = mount(EsFormMsg, {
slots,
propsData: {
variant,
show: true,
},
});
expect(wrapper.vm).toBeTruthy();
expect(wrapper.html()).toMatchSnapshot();
});
test(`<EsFormMsg variant="${variant}" show="false" />`, async () => {
const wrapper = mount(EsFormMsg, {
slots,
propsData: {
variant,
show: false,
},
});
expect(wrapper.vm).toBeTruthy();
expect(wrapper.html()).toMatchSnapshot();
});
});
});