blob: 8706f2f8d835cb6c81f529431982cfd0cf6d8e9a (
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
|
import { shallowMount } from '@vue/test-utils';
import ReportItem from '~/reports/components/issue_status_icon.vue';
import { STATUS_FAILED, STATUS_NEUTRAL, STATUS_SUCCESS } from '~/reports/constants';
describe('IssueStatusIcon', () => {
let wrapper;
const createComponent = ({ status }) => {
wrapper = shallowMount(ReportItem, {
propsData: {
status,
},
});
};
afterEach(() => {
wrapper.destroy();
wrapper = null;
});
it.each([STATUS_SUCCESS, STATUS_NEUTRAL, STATUS_FAILED])(
'renders "%s" state correctly',
(status) => {
createComponent({ status });
expect(wrapper.element).toMatchSnapshot();
},
);
});
|