Commit 27f0d546 authored by Mark Florian's avatar Mark Florian

Render snapshots with new VulnerabilityDetails

This swaps out the component factory functions which rendered the old
`vulnerability-details` component, in each of the MR and Security
Dashboard contexts, with a new factory function that renders only the
new version of the component.

The snapshot changes in this commit correspond to the expected changes:

- the MR context now includes (if available):
  - the project the vulnerability belongs to
  - the report type of the vulnerability
  - the line number information for the `file`
- the Security Dashboard context now includes (if available):
  - the method in which the vulnerability was detected
parent 4b3d02d8
...@@ -193,16 +193,24 @@ describe('VulnerabilityDetails component pin tests', () => { ...@@ -193,16 +193,24 @@ describe('VulnerabilityDetails component pin tests', () => {
}); });
}; };
const factory = vulnFinding => {
wrapper = mount(VulnerabilityDetails2, {
propsData: {
vulnerability: vulnFinding,
},
});
};
describe('in grouped_security_reports_app', () => { describe('in grouped_security_reports_app', () => {
it.each(findings.map(v => [v.name, v]))('works for %s', (_, finding) => { it.each(findings.map(v => [v.name, v]))('works for %s', (_, finding) => {
mrFactory(finding); factory(finding);
expect(wrapper.element).toMatchSnapshot(); expect(wrapper.element).toMatchSnapshot();
}); });
}); });
describe('in Security Dashboards', () => { describe('in Security Dashboards', () => {
it.each(findings.map(v => [v.name, v]))('works for %s', (_, finding) => { it.each(findings.map(v => [v.name, v]))('works for %s', (_, finding) => {
dashboardFactory(finding); factory(finding);
expect(wrapper.element).toMatchSnapshot(); 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