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
83fc82f8
Commit
83fc82f8
authored
Dec 16, 2019
by
Paul Slaughter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move setUrlParams describe under top describe
parent
0492b97d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
31 deletions
+31
-31
spec/frontend/lib/utils/url_utility_spec.js
spec/frontend/lib/utils/url_utility_spec.js
+31
-31
No files found.
spec/frontend/lib/utils/url_utility_spec.js
View file @
83fc82f8
...
...
@@ -330,46 +330,46 @@ describe('URL utility', () => {
expect
(
urlUtils
.
escapeFileUrl
(
'
foo/bar/file.md
'
)).
toBe
(
'
foo/bar/file.md
'
);
});
});
});
describe
(
'
setUrlParams
'
,
()
=>
{
it
(
'
adds new params as query string
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test
'
;
describe
(
'
setUrlParams
'
,
()
=>
{
it
(
'
adds new params as query string
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test
'
;
expect
(
urlUtils
.
setUrlParams
({
group_id
:
'
gitlab-org
'
,
project_id
:
'
my-project
'
},
url
),
).
toEqual
(
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
);
});
expect
(
urlUtils
.
setUrlParams
({
group_id
:
'
gitlab-org
'
,
project_id
:
'
my-project
'
},
url
),
).
toEqual
(
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
);
});
it
(
'
updates an existing parameter
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
;
it
(
'
updates an existing parameter
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
;
expect
(
urlUtils
.
setUrlParams
({
project_id
:
'
gitlab-test
'
},
url
)).
toEqual
(
'
https://gitlab.com/test?group_id=gitlab-org&project_id=gitlab-test
'
,
);
});
expect
(
urlUtils
.
setUrlParams
({
project_id
:
'
gitlab-test
'
},
url
)).
toEqual
(
'
https://gitlab.com/test?group_id=gitlab-org&project_id=gitlab-test
'
,
);
});
it
(
"
removes the project_id param when it's value is null
"
,
()
=>
{
const
url
=
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
;
it
(
"
removes the project_id param when it's value is null
"
,
()
=>
{
const
url
=
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
;
expect
(
urlUtils
.
setUrlParams
({
project_id
:
null
},
url
)).
toEqual
(
'
https://gitlab.com/test?group_id=gitlab-org
'
,
);
});
expect
(
urlUtils
.
setUrlParams
({
project_id
:
null
},
url
)).
toEqual
(
'
https://gitlab.com/test?group_id=gitlab-org
'
,
);
});
it
(
'
handles arrays properly
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test
'
;
it
(
'
handles arrays properly
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test
'
;
expect
(
urlUtils
.
setUrlParams
({
label_name
:
[
'
foo
'
,
'
bar
'
]
},
url
)).
toEqual
(
'
https://gitlab.com/test?label_name=foo&label_name=bar
'
,
);
});
expect
(
urlUtils
.
setUrlParams
({
label_name
:
[
'
foo
'
,
'
bar
'
]
},
url
)).
toEqual
(
'
https://gitlab.com/test?label_name=foo&label_name=bar
'
,
);
});
it
(
'
removes all existing URL params and sets a new param when cleanParams=true
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
;
it
(
'
removes all existing URL params and sets a new param when cleanParams=true
'
,
()
=>
{
const
url
=
'
https://gitlab.com/test?group_id=gitlab-org&project_id=my-project
'
;
expect
(
urlUtils
.
setUrlParams
({
foo
:
'
bar
'
},
url
,
true
)).
toEqual
(
'
https://gitlab.com/test?foo=bar
'
,
);
expect
(
urlUtils
.
setUrlParams
({
foo
:
'
bar
'
},
url
,
true
)).
toEqual
(
'
https://gitlab.com/test?foo=bar
'
,
);
});
});
});
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