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
0c870f91
Commit
0c870f91
authored
Aug 22, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix vulnerability header.vue test
parent
7e972b77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
54 deletions
+0
-54
ee/spec/frontend/vulnerabilities/header_spec.js
ee/spec/frontend/vulnerabilities/header_spec.js
+0
-54
No files found.
ee/spec/frontend/vulnerabilities/header_spec.js
View file @
0c870f91
...
...
@@ -145,18 +145,6 @@ describe('Vulnerability Header', () => {
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
});
});
it
(
'
when the vulnerability state changes but the change is undefined, an error message is displayed
'
,
()
=>
{
const
dropdown
=
wrapper
.
find
(
VulnerabilityStateDropdown
);
mockAxios
.
onPost
().
reply
(
200
);
dropdown
.
vm
.
$emit
(
'
change
'
,
undefined
);
return
waitForPromises
().
then
(()
=>
{
expect
(
mockAxios
.
history
.
post
).
toHaveLength
(
1
);
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
});
});
});
describe
(
'
split button
'
,
()
=>
{
...
...
@@ -376,46 +364,4 @@ describe('Vulnerability Header', () => {
});
});
});
describe
(
'
when vulnerability state is changed
'
,
()
=>
{
it
(
'
refreshes the vulnerability
'
,
async
()
=>
{
const
url
=
Api
.
buildUrl
(
Api
.
vulnerabilityPath
).
replace
(
'
:id
'
,
defaultVulnerability
.
id
);
const
vulnerability
=
{
state
:
'
dismissed
'
};
mockAxios
.
onGet
(
url
).
replyOnce
(
200
,
vulnerability
);
createWrapper
();
wrapper
.
vm
.
$emit
(
'
vulnerability-state-change
'
);
await
waitForPromises
();
expect
(
findBadge
().
text
()).
toBe
(
vulnerability
.
state
);
expect
(
findStatusDescription
().
props
(
'
vulnerability
'
)).
toMatchObject
(
vulnerability
);
});
it
(
'
shows an error message when the vulnerability cannot be loaded
'
,
async
()
=>
{
mockAxios
.
onGet
().
replyOnce
(
500
);
createWrapper
();
wrapper
.
vm
.
$emit
(
'
vulnerability-state-change
'
);
await
waitForPromises
();
expect
(
createFlash
).
toHaveBeenCalledTimes
(
1
);
expect
(
mockAxios
.
history
.
get
).
toHaveLength
(
1
);
});
it
(
'
cancels a pending refresh request if the vulnerability state has changed
'
,
async
()
=>
{
mockAxios
.
onGet
().
reply
(
200
);
createWrapper
();
wrapper
.
vm
.
$emit
(
'
vulnerability-state-change
'
);
const
source
=
wrapper
.
vm
.
refreshVulnerabilitySource
;
const
spy
=
jest
.
spyOn
(
source
,
'
cancel
'
);
wrapper
.
vm
.
$emit
(
'
vulnerability-state-change
'
);
await
waitForPromises
();
expect
(
createFlash
).
toHaveBeenCalledTimes
(
0
);
expect
(
mockAxios
.
history
.
get
).
toHaveLength
(
1
);
expect
(
spy
).
toHaveBeenCalled
();
expect
(
wrapper
.
vm
.
refreshVulnerabilitySource
).
not
.
toBe
(
source
);
// Check that the source has changed.
});
});
});
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