forked from EnergySage/es-ds
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEsFileThumbnail.spec.js
37 lines (31 loc) · 1.19 KB
/
EsFileThumbnail.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 EsFileThumbnail from '@/src/lib-components/EsFileThumbnail.vue';
import jestVue from '@/tests/jest.vue.config';
describe('EsFileThumbnail', () => {
test('<EsFileThumbnail />', async () => {
const wrapper = mount(EsFileThumbnail, {
...jestVue,
});
const a11y = await axe(wrapper.element);
expect(wrapper.vm).toBeTruthy();
expect(wrapper.html()).toMatchSnapshot();
expect(a11y).toHaveNoViolations();
});
test('check for <EsFileThumbnail />', async () => {
const wrapper = mount(EsFileThumbnail, {
...jestVue,
});
expect(wrapper.find('.mobile-preview').exists()).toBe(true);
expect(wrapper.find('.desktop-preview').exists()).toBe(true);
});
// test default prop values
test('<EsFileThumbnail /> default prop values', async () => {
const wrapper = mount(EsFileThumbnail, {
...jestVue,
});
expect(wrapper.vm).toBeTruthy();
expect(wrapper.html()).toMatchSnapshot();
expect(wrapper.props('percentLoaded')).toBe(0);
expect(wrapper.props('previewText')).toBe('View preview');
});
});