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
d17168fa
Commit
d17168fa
authored
Aug 22, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update footer_spec to fix failing tests
parent
1711d2a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
ee/spec/frontend/vulnerabilities/footer_spec.js
ee/spec/frontend/vulnerabilities/footer_spec.js
+12
-8
No files found.
ee/spec/frontend/vulnerabilities/footer_spec.js
View file @
d17168fa
...
...
@@ -2,7 +2,6 @@ import { shallowMount } from '@vue/test-utils';
import
Api
from
'
ee/api
'
;
import
VulnerabilityFooter
from
'
ee/vulnerabilities/components/footer.vue
'
;
import
HistoryEntry
from
'
ee/vulnerabilities/components/history_entry.vue
'
;
import
VulnerabilitiesEventBus
from
'
ee/vulnerabilities/components/vulnerabilities_event_bus
'
;
import
RelatedIssues
from
'
ee/vulnerabilities/components/related_issues.vue
'
;
import
SolutionCard
from
'
ee/vue_shared/security_reports/components/solution_card.vue
'
;
import
IssueNote
from
'
ee/vue_shared/security_reports/components/issue_note.vue
'
;
...
...
@@ -64,11 +63,14 @@ describe('Vulnerability Footer', () => {
mockAxios
.
reset
();
});
describe
(
'
vulnerabilities event bus listener
'
,
()
=>
{
it
(
'
calls the discussion url on
vulnerabilities event bus emit of VULNERABILITY_STATE_CHANGE
'
,
()
=>
{
describe
(
'
fetching discussions
'
,
()
=>
{
it
(
'
calls the discussion url on
if fetchDiscussions is called by the root
'
,
async
()
=>
{
createWrapper
();
jest
.
spyOn
(
axios
,
'
get
'
);
VulnerabilitiesEventBus
.
$emit
(
'
VULNERABILITY_STATE_CHANGE
'
);
wrapper
.
vm
.
fetchDiscussions
();
await
axios
.
waitForAll
();
expect
(
axios
.
get
).
toHaveBeenCalledTimes
(
1
);
});
});
...
...
@@ -252,16 +254,18 @@ describe('Vulnerability Footer', () => {
});
});
it
(
'
emits the VULNERABILITY_STATE_CHANGED event when the system note is new
'
,
async
()
=>
{
const
spy
=
jest
.
spyOn
(
VulnerabilitiesEventBus
,
'
$emit
'
);
it
(
'
emits the vulnerability-state-change event when the system note is new
'
,
async
()
=>
{
const
handler
=
jest
.
fn
();
wrapper
.
vm
.
$on
(
'
vulnerability-state-change
'
,
handler
);
const
note
=
{
system
:
true
,
id
:
1
,
discussion_id
:
3
};
createNotesRequest
(
note
);
await
axios
.
waitForAll
();
await
startTimeoutsAndAwaitRequests
();
expect
(
spy
).
toHaveBeenCalledTimes
(
1
);
expect
(
spy
).
toHaveBeenCalledWith
(
'
VULNERABILITY_STATE_CHANGED
'
);
expect
(
handler
).
toHaveBeenCalledTimes
(
1
);
});
});
});
...
...
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