Commit 7eba40d3 authored by Savas Vedova's avatar Savas Vedova

Implement code review suggestions

parent dbeea6c3
......@@ -32,8 +32,28 @@ describe('Vulnerabilities count list component', () => {
});
});
describe('when there are no counts', () => {
beforeEach(() => {
wrapper = createWrapper({ propsData: { vulnerabilitiesCount: {} } });
});
it.each`
index | name
${0} | ${'critical'}
${1} | ${'high'}
${2} | ${'medium'}
${3} | ${'low'}
${4} | ${'info'}
${5} | ${'unknown'}
`('shows 0 count for $name', ({ index, name }) => {
const vulnerability = findVulnerability().at(index);
expect(vulnerability.props('severity')).toBe(name);
expect(vulnerability.props('count')).toBe(0);
});
});
describe('when loaded and has a list of vulnerability counts', () => {
const vulnerabilitiesCount = { critical: 5, medium: 3, info: 1, unknown: 2, low: 0, high: 0 };
const vulnerabilitiesCount = { critical: 5, medium: 3, info: 1, unknown: 2, low: 3, high: 8 };
beforeEach(() => {
wrapper = createWrapper({ propsData: { vulnerabilitiesCount } });
......
......@@ -38,6 +38,8 @@ describe('Vulnerabilities count list component', () => {
high: 3,
low: 19,
info: 4,
medium: 2,
unknown: 4,
},
});
});
......@@ -52,6 +54,8 @@ describe('Vulnerabilities count list component', () => {
high: 3,
low: 19,
info: 4,
medium: 2,
unknown: 4,
});
});
});
......
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