Commit 125f2bb2 authored by Filipa Lacerda's avatar Filipa Lacerda

Fix inconsistencies between text report

parent 16697943
......@@ -20,10 +20,11 @@
},
computed: {
summarySastText() {
const text = s__('ciReport|SAST detected %{link}');
let text;
let link;
if (this.unresolvedIssues.length) {
text = s__('ciReport|SAST degraded on %{link}');
link = this.unresolvedIssues.length > 1 ?
this.getLink(sprintf(
s__('ciReport|%{d} security vulnerabilities'),
......@@ -32,6 +33,7 @@
)) :
this.getLink(s__('ciReport|1 security vulnerability'));
} else {
text = s__('ciReport|SAST detected %{link}');
link = this.getLink(s__('ciReport|no security vulnerabilities'));
}
......
......@@ -24,7 +24,7 @@ describe('SAST report summary widget', () => {
});
it('renders summary text with link for the security tab', () => {
expect(vm.$el.textContent.trim()).toEqual('SAST detected 2 security vulnerabilities');
expect(vm.$el.textContent.trim()).toEqual('SAST degraded on 2 security vulnerabilities');
expect(vm.$el.querySelector('a').getAttribute('href')).toEqual('group/project/pipelines/2/security');
});
});
......
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