Commit 0e2f623a authored by Fernando Arias's avatar Fernando Arias Committed by Mark Florian

Hide coverage fuzz testing mr widget

* Hide when we don't have endpoint path defined
* Prettier code cleanup
parent ca776698
......@@ -223,7 +223,14 @@ export default {
return this.enabledReports.dast;
},
hasCoverageFuzzingReports() {
return this.enabledReports.coverageFuzzing;
/*
* Fixes bug https://gitlab.com/gitlab-org/gitlab/-/issues/255183
* For https://gitlab.com/gitlab-org/gitlab/-/issues/210343 change to:
* return this.enabledReports.coverageFuzzing;
*/
return (
gl?.mrWidgetData?.coverage_fuzzing_comparison_path && this.enabledReports.coverageFuzzing
);
},
hasSastReports() {
return this.enabledReports.sast;
......
......@@ -581,6 +581,40 @@ describe('Grouped security reports app', () => {
});
});
describe('coverage fuzzing reports', () => {
/*
* Fixes bug https://gitlab.com/gitlab-org/gitlab/-/issues/255183
* For https://gitlab.com/gitlab-org/gitlab/-/issues/210343
* replace with updated tests
*/
describe.each`
endpoint | shouldShowFuzzing
${'/fuzzing'} | ${true}
${undefined} | ${false}
`(
'given coverage fuzzing comparision enpoint is $endpoint',
({ endpoint, shouldShowFuzzing }) => {
beforeEach(() => {
gl.mrWidgetData = gl.mrWidgetData || {};
gl.mrWidgetData.coverage_fuzzing_comparison_path = endpoint;
createWrapper({
...props,
enabledReports: {
coverageFuzzing: true,
},
});
});
it(`${shouldShowFuzzing ? 'renders' : 'does not render'}`, () => {
expect(wrapper.find('[data-qa-selector="coverage_fuzzing_report"]').exists()).toBe(
shouldShowFuzzing,
);
});
},
);
});
describe('Out of date report', () => {
const createComponent = (extraProp, done) => {
gl.mrWidgetData = gl.mrWidgetData || {};
......
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