blob: fb13d4407e236bd8c317304c4d956b04f89f947d (
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 '~/ci/reports/components/issue_status_icon.vue';
import { STATUS_FAILED, STATUS_NEUTRAL, STATUS_SUCCESS } from '~/ci/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();
},
);
});
|