Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6b7f6a55
Commit
6b7f6a55
authored
Jun 30, 2020
by
Alexander Turinske
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update tests to not hard-code strings
- use mock data for tests
parent
658a2aa2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ee/spec/frontend/vulnerabilities/vulnerability_list_spec.js
ee/spec/frontend/vulnerabilities/vulnerability_list_spec.js
+11
-6
No files found.
ee/spec/frontend/vulnerabilities/vulnerability_list_spec.js
View file @
6b7f6a55
...
...
@@ -118,23 +118,28 @@ describe('Vulnerability list component', () => {
it
(
'
should display the vulnerability locations
'
,
()
=>
{
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
0
].
id
}
`
).
text
()).
toContain
(
'
Administrator / Security reports
'
,
newVulnerabilities
[
0
].
project
.
nameWithNamespace
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
0
].
id
}
`
).
text
()).
toContain
(
'
registry.gitlab.com/groulot/container-scanning-test/master:5f21de6956aee99ddb68ae49498662d9872f50ff
'
,
newVulnerabilities
[
0
].
location
.
image
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
0
].
id
}
`
).
text
()).
not
.
toContain
(
'
(line:
'
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
1
].
id
}
`
).
text
()).
toContain
(
'
Administrator / Vulnerability reports
'
,
newVulnerabilities
[
1
].
project
.
nameWithNamespace
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
1
].
id
}
`
).
text
()).
toContain
(
'
src/main/java/com/gitlab/security_products/tests/App.java (line: 1337)
'
,
newVulnerabilities
[
1
].
location
.
file
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
1
].
id
}
`
).
text
()).
toContain
(
newVulnerabilities
[
1
].
location
.
startLine
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
2
].
id
}
`
).
text
()).
toContain
(
'
Mixed Vulnerabilities / Dependency List Test 01
'
,
newVulnerabilities
[
2
].
project
.
nameWithNamespace
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
2
].
id
}
`
).
text
()).
toContain
(
'
src/main/java/com/gitlab/security_products/tests/App.java
'
,
newVulnerabilities
[
2
].
location
.
file
,
);
expect
(
findDataCell
(
`location-
${
newVulnerabilities
[
2
].
id
}
`
).
text
()).
not
.
toContain
(
'
(line:
'
);
});
it
(
'
should not display the vulnerability report type
'
,
()
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment