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
b45accce
Commit
b45accce
authored
May 07, 2020
by
Dave Pisek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maintainer feedback: Spec helper tests
* Adds test to cover `set_window_location_helper`
parent
f59ae04e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
spec/frontend/helpers/set_window_location_helper_spec.js
spec/frontend/helpers/set_window_location_helper_spec.js
+29
-0
No files found.
spec/frontend/helpers/set_window_location_helper_spec.js
0 → 100644
View file @
b45accce
import
setWindowLocationHelper
from
'
./set_window_location_helper
'
;
describe
(
'
setWindowLocationHelper
'
,
()
=>
{
const
originalLocation
=
window
.
location
;
afterEach
(()
=>
{
window
.
location
=
originalLocation
;
});
it
.
each
`
locationProperty | value
${
'
hash
'
}
|
${
'
foo
'
}
${
'
host
'
}
|
${
'
gitlab.com
'
}
${
'
hostname
'
}
|
${
'
gitlab.com
'
}
${
'
href
'
}
|
${
'
https://gitlab.com/foo
'
}
${
'
origin
'
}
|
${
'
https://gitlab.com
'
}
${
'
origin
'
}
|
${
'
/foo
'
}
${
'
port
'
}
|
${
'
80
'
}
${
'
protocol
'
}
|
${
'
https:
'
}
`
(
'
sets "window.location.$locationProperty" to be $value
'
,
({
locationProperty
,
value
})
=>
{
expect
(
window
.
location
[
locationProperty
]).
not
.
toBe
(
value
);
setWindowLocationHelper
({
[
locationProperty
]:
value
,
});
expect
(
window
.
location
[
locationProperty
]).
toBe
(
value
);
});
});
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