Commit 150e626d authored by Dave Pisek's avatar Dave Pisek

Add snapshot tests

parent 5c1f11f1
......@@ -8,7 +8,6 @@ export default {
Icon,
},
props: {
// failed || success
status: {
type: String,
required: true,
......
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`IssueStatusIcon renders "failed" state correctly 1`] = `
<div
class="report-block-list-icon failed"
>
<icon-stub
data-qa-selector="status_failed_icon"
name="status_failed_borderless"
size="24"
/>
</div>
`;
exports[`IssueStatusIcon renders "neutral" state correctly 1`] = `
<div
class="report-block-list-icon neutral"
>
<icon-stub
data-qa-selector="status_neutral_icon"
name="dash"
size="24"
/>
</div>
`;
exports[`IssueStatusIcon renders "success" state correctly 1`] = `
<div
class="report-block-list-icon success"
>
<icon-stub
data-qa-selector="status_success_icon"
name="status_success_borderless"
size="24"
/>
</div>
`;
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();
},
);
});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment