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
81e96a66
Commit
81e96a66
authored
Feb 01, 2021
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Specs: use async/await for trigger calls
* `.trigger` calls are async
parent
f4ffeb31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
ee/spec/frontend/security_dashboard/components/vulnerability_action_buttons_spec.js
...dashboard/components/vulnerability_action_buttons_spec.js
+8
-8
No files found.
ee/spec/frontend/security_dashboard/components/vulnerability_action_buttons_spec.js
View file @
81e96a66
...
...
@@ -58,8 +58,8 @@ describe('Security Dashboard Action Buttons', () => {
expect
(
findMoreInfoButton
().
exists
()).
toBe
(
true
);
});
it
(
'
should emit an `setModalData` event and open the modal when clicked
'
,
()
=>
{
findMoreInfoButton
().
trigger
(
'
click
'
);
it
(
'
should emit an `setModalData` event and open the modal when clicked
'
,
async
()
=>
{
await
findMoreInfoButton
().
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
$store
.
dispatch
).
toHaveBeenCalledWith
(
'
vulnerabilities/setModalData
'
,
{
vulnerability
:
mockDataVulnerabilities
[
0
],
...
...
@@ -79,8 +79,8 @@ describe('Security Dashboard Action Buttons', () => {
expect
(
findCreateIssueButton
().
attributes
(
'
title
'
)).
toBe
(
i18n
.
createIssue
);
});
it
(
'
should emit an `createIssue` event when clicked
'
,
()
=>
{
findCreateIssueButton
().
trigger
(
'
click
'
);
it
(
'
should emit an `createIssue` event when clicked
'
,
async
()
=>
{
await
findCreateIssueButton
().
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
$store
.
dispatch
).
toHaveBeenCalledWith
(
'
vulnerabilities/createIssue
'
,
{
vulnerability
:
mockDataVulnerabilities
[
0
],
...
...
@@ -105,11 +105,11 @@ describe('Security Dashboard Action Buttons', () => {
expect
(
findCreateIssueButton
().
attributes
(
'
title
'
)).
toBe
(
i18n
.
createJiraIssue
);
});
it
(
'
should open a new window when the create-issue button is clicked
'
,
()
=>
{
it
(
'
should open a new window when the create-issue button is clicked
'
,
async
()
=>
{
jest
.
spyOn
(
window
,
'
open
'
).
mockReturnValueOnce
();
expect
(
window
.
open
).
not
.
toHaveBeenCalled
();
findCreateIssueButton
().
trigger
(
'
click
'
);
await
findCreateIssueButton
().
trigger
(
'
click
'
);
expect
(
window
.
open
).
toHaveBeenCalledWith
(
mockDataVulnerabilities
[
8
].
create_jira_issue_url
,
...
...
@@ -124,8 +124,8 @@ describe('Security Dashboard Action Buttons', () => {
expect
(
findDismissVulnerabilityButton
().
exists
()).
toBe
(
true
);
});
it
(
'
should emit an `dismissVulnerability` event when clicked
'
,
()
=>
{
findDismissVulnerabilityButton
().
trigger
(
'
click
'
);
it
(
'
should emit an `dismissVulnerability` event when clicked
'
,
async
()
=>
{
await
findDismissVulnerabilityButton
().
trigger
(
'
click
'
);
expect
(
wrapper
.
vm
.
$store
.
dispatch
).
toHaveBeenCalledWith
(
'
vulnerabilities/dismissVulnerability
'
,
...
...
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