blob: 5e8b013d48080564d089beea45b7d4af5edd0027 (
plain)
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
|
import { shallowMount } from '@vue/test-utils';
import IdenticonComponent from '~/vue_shared/components/identicon.vue';
describe('Identicon', () => {
let wrapper;
const createComponent = () => {
wrapper = shallowMount(IdenticonComponent, {
propsData: {
entityId: 1,
entityName: 'entity-name',
sizeClass: 's40',
},
});
};
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it('matches snapshot', () => {
createComponent();
expect(wrapper.element).toMatchSnapshot();
});
it('adds a correct class to identicon', () => {
createComponent();
expect(wrapper.find({ ref: 'identicon' }).classes()).toContain('bg2');
});
});
|