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
43997a7b
Commit
43997a7b
authored
May 23, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix broken tests - missing setTimeout
parent
d9d5bdf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
5 deletions
+24
-5
spec/javascripts/vue_shared/security_reports/grouped_security_reports_app_spec.js
...red/security_reports/grouped_security_reports_app_spec.js
+18
-3
spec/javascripts/vue_shared/security_reports/split_security_reports_app_spec.js
...hared/security_reports/split_security_reports_app_spec.js
+6
-2
No files found.
spec/javascripts/vue_shared/security_reports/grouped_security_reports_app_spec.js
View file @
43997a7b
...
...
@@ -32,9 +32,9 @@ describe('Grouped security reports app', () => {
});
afterEach
(()
=>
{
vm
.
$store
.
replaceState
(
state
());
vm
.
$destroy
();
mock
.
restore
();
vm
.
$store
.
replaceState
(
state
());
});
describe
(
'
with error
'
,
()
=>
{
...
...
@@ -126,7 +126,7 @@ describe('Grouped security reports app', () => {
});
});
it
(
'
renders loading summary text + spinner
'
,
()
=>
{
it
(
'
renders loading summary text + spinner
'
,
(
done
)
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.fa-spinner
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
querySelector
(
'
.js-code-text
'
).
textContent
.
trim
()).
toEqual
(
'
Security scanning is loading
'
,
...
...
@@ -137,6 +137,10 @@ describe('Grouped security reports app', () => {
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Dependency scanning is loading
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Container scanning is loading
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
DAST is loading
'
);
setTimeout
(()
=>
{
done
();
},
0
);
});
});
...
...
@@ -175,19 +179,30 @@ describe('Grouped security reports app', () => {
it
(
'
renders reports
'
,
done
=>
{
setTimeout
(()
=>
{
// It's not loading
expect
(
vm
.
$el
.
querySelector
(
'
.fa-spinner
'
)).
toBeNull
();
// Renders the summary text
expect
(
vm
.
$el
.
querySelector
(
'
.js-code-text
'
).
textContent
.
trim
()).
toEqual
(
'
Security scanning detected
12 new vulnerabilities and 4
fixed vulnerabilities
'
,
'
Security scanning detected
6 new vulnerabilities and 2
fixed vulnerabilities
'
,
);
// Renders the expand button
expect
(
vm
.
$el
.
querySelector
(
'
.js-collapse-btn
'
).
textContent
.
trim
()).
toEqual
(
'
Expand
'
);
// Renders Sast result
expect
(
removeBreakLine
(
vm
.
$el
.
textContent
)).
toContain
(
'
SAST detected 2 new vulnerabilities and 1 fixed vulnerability
'
,
);
// Renders DSS result
expect
(
removeBreakLine
(
vm
.
$el
.
textContent
)).
toContain
(
'
Dependency scanning detected 2 new vulnerabilities and 1 fixed vulnerability
'
,
);
// Renders container scanning result
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Container scanning detected 1 new vulnerability
'
);
// Renders DAST result
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
DAST detected 1 new vulnerability
'
);
done
();
},
0
);
...
...
spec/javascripts/vue_shared/security_reports/split_security_reports_app_spec.js
View file @
43997a7b
...
...
@@ -25,9 +25,9 @@ describe('Slipt security reports app', () => {
});
afterEach
(()
=>
{
vm
.
$store
.
replaceState
(
state
());
vm
.
$destroy
();
mock
.
restore
();
vm
.
$store
.
replaceState
(
state
());
});
describe
(
'
while loading
'
,
()
=>
{
...
...
@@ -52,11 +52,15 @@ describe('Slipt security reports app', () => {
});
});
it
(
'
renders loading summary text + spinner
'
,
()
=>
{
it
(
'
renders loading summary text + spinner
'
,
done
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.fa-spinner
'
)).
not
.
toBeNull
();
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
SAST is loading
'
);
expect
(
vm
.
$el
.
textContent
).
toContain
(
'
Dependency scanning is loading
'
);
setTimeout
(()
=>
{
done
();
},
0
);
});
});
...
...
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