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
2163f4b2
Commit
2163f4b2
authored
Jun 11, 2020
by
Himanshu Kapoor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate spec/frontend/performance_bar to Jest
parent
6cd7be28
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
spec/frontend/performance_bar/index_spec.js
spec/frontend/performance_bar/index_spec.js
+8
-3
No files found.
spec/
javascripts
/performance_bar/index_spec.js
→
spec/
frontend
/performance_bar/index_spec.js
View file @
2163f4b2
...
...
@@ -9,6 +9,11 @@ describe('performance bar wrapper', () => {
let
vm
;
beforeEach
(()
=>
{
URL
.
createObjectURL
=
jest
.
fn
();
performance
.
getEntriesByType
=
jest
.
fn
().
mockReturnValue
([]);
// clear html so that elements from previous tests don't mess with this test
document
.
body
.
innerHTML
=
''
;
const
peekWrapper
=
document
.
createElement
(
'
div
'
);
peekWrapper
.
setAttribute
(
'
id
'
,
'
js-peek
'
);
...
...
@@ -49,11 +54,11 @@ describe('performance bar wrapper', () => {
describe
(
'
loadRequestDetails
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
vm
.
store
,
'
addRequest
'
).
and
.
callThrough
(
);
jest
.
spyOn
(
vm
.
store
,
'
addRequest
'
);
});
it
(
'
does nothing if the request cannot be tracked
'
,
()
=>
{
spyOn
(
vm
.
store
,
'
canTrackRequest
'
).
and
.
callFake
(()
=>
false
);
jest
.
spyOn
(
vm
.
store
,
'
canTrackRequest
'
).
mockImplementation
(()
=>
false
);
vm
.
loadRequestDetails
(
'
123
'
,
'
https://gitlab.com/
'
);
...
...
@@ -67,7 +72,7 @@ describe('performance bar wrapper', () => {
});
it
(
'
makes an HTTP request for the request details
'
,
()
=>
{
spyOn
(
PerformanceBarService
,
'
fetchRequestDetails
'
).
and
.
callThrough
(
);
jest
.
spyOn
(
PerformanceBarService
,
'
fetchRequestDetails
'
);
vm
.
loadRequestDetails
(
'
456
'
,
'
https://gitlab.com/
'
);
...
...
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