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
b82ba9b5
Commit
b82ba9b5
authored
Jul 28, 2020
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve descriptions of router tests
parent
6f1dda13
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
19 deletions
+16
-19
spec/frontend/monitoring/router_spec.js
spec/frontend/monitoring/router_spec.js
+16
-19
No files found.
spec/frontend/monitoring/router_spec.js
View file @
b82ba9b5
...
@@ -49,14 +49,14 @@ describe('Monitoring router', () => {
...
@@ -49,14 +49,14 @@ describe('Monitoring router', () => {
window
.
location
.
hash
=
''
;
window
.
location
.
hash
=
''
;
});
});
describe
(
'
support legacy URL with full dashboard path to visit dashboard page
'
,
()
=>
{
describe
(
'
support legacy URL
s
with full dashboard path to visit dashboard page
'
,
()
=>
{
it
.
each
`
it
.
each
`
route
| currentDashboard
path
| currentDashboard
${
'
/dashboard.yml
'
}
|
${
'
dashboard.yml
'
}
${
'
/dashboard.yml
'
}
|
${
'
dashboard.yml
'
}
${
'
/folder1/dashboard.yml
'
}
|
${
'
folder1/dashboard.yml
'
}
${
'
/folder1/dashboard.yml
'
}
|
${
'
folder1/dashboard.yml
'
}
${
'
/?dashboard=dashboard.yml
'
}
|
${
'
dashboard.yml
'
}
${
'
/?dashboard=dashboard.yml
'
}
|
${
'
dashboard.yml
'
}
`
(
'
sets component as $componentName for path "$route"
'
,
({
route
,
currentDashboard
})
=>
{
`
(
'
"$path" renders page with dashboard "$currentDashboard"
'
,
({
path
,
currentDashboard
})
=>
{
const
wrapper
=
createWrapper
(
LEGACY_BASE_PATH
,
route
);
const
wrapper
=
createWrapper
(
LEGACY_BASE_PATH
,
path
);
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
monitoringDashboard/setCurrentDashboard
'
,
{
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
monitoringDashboard/setCurrentDashboard
'
,
{
currentDashboard
,
currentDashboard
,
...
@@ -72,9 +72,9 @@ describe('Monitoring router', () => {
...
@@ -72,9 +72,9 @@ describe('Monitoring router', () => {
});
});
});
});
describe
(
'
supports URL to visit dashboard page
'
,
()
=>
{
describe
(
'
supports URL
s
to visit dashboard page
'
,
()
=>
{
it
.
each
`
it
.
each
`
route
| currentDashboard
path
| currentDashboard
${
'
/
'
}
|
${
null
}
${
'
/
'
}
|
${
null
}
${
'
/dashboard.yml
'
}
|
${
'
dashboard.yml
'
}
${
'
/dashboard.yml
'
}
|
${
'
dashboard.yml
'
}
${
'
/folder1/dashboard.yml
'
}
|
${
'
folder1/dashboard.yml
'
}
${
'
/folder1/dashboard.yml
'
}
|
${
'
folder1/dashboard.yml
'
}
...
@@ -83,8 +83,8 @@ describe('Monitoring router', () => {
...
@@ -83,8 +83,8 @@ describe('Monitoring router', () => {
${
'
/config/prometheus/common_metrics.yml
'
}
|
${
'
config/prometheus/common_metrics.yml
'
}
${
'
/config/prometheus/common_metrics.yml
'
}
|
${
'
config/prometheus/common_metrics.yml
'
}
${
'
/config/prometheus/pod_metrics.yml
'
}
|
${
'
config/prometheus/pod_metrics.yml
'
}
${
'
/config/prometheus/pod_metrics.yml
'
}
|
${
'
config/prometheus/pod_metrics.yml
'
}
${
'
/config%2Fprometheus%2Fpod_metrics.yml
'
}
|
${
'
config/prometheus/pod_metrics.yml
'
}
${
'
/config%2Fprometheus%2Fpod_metrics.yml
'
}
|
${
'
config/prometheus/pod_metrics.yml
'
}
`
(
'
sets component as $componentName for path "$route"
'
,
({
route
,
currentDashboard
})
=>
{
`
(
'
"$path" renders page with dashboard "$currentDashboard"
'
,
({
path
,
currentDashboard
})
=>
{
const
wrapper
=
createWrapper
(
BASE_PATH
,
route
);
const
wrapper
=
createWrapper
(
BASE_PATH
,
path
);
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
monitoringDashboard/setCurrentDashboard
'
,
{
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
monitoringDashboard/setCurrentDashboard
'
,
{
currentDashboard
,
currentDashboard
,
...
@@ -100,21 +100,18 @@ describe('Monitoring router', () => {
...
@@ -100,21 +100,18 @@ describe('Monitoring router', () => {
});
});
});
});
describe
(
'
supports URL to visit new panel page
'
,
()
=>
{
describe
(
'
supports URL
s
to visit new panel page
'
,
()
=>
{
it
.
each
`
it
.
each
`
route
| currentDashboard
path
| currentDashboard
${
'
/panel/new
'
}
|
${
undefined
}
${
'
/panel/new
'
}
|
${
undefined
}
${
'
/dashboard.yml/panel/new
'
}
|
${
'
dashboard.yml
'
}
${
'
/dashboard.yml/panel/new
'
}
|
${
'
dashboard.yml
'
}
${
'
/config/prometheus/common_metrics.yml/panel/new
'
}
|
${
'
config/prometheus/common_metrics.yml
'
}
${
'
/config/prometheus/common_metrics.yml/panel/new
'
}
|
${
'
config/prometheus/common_metrics.yml
'
}
${
'
/config%2Fprometheus%2Fcommon_metrics.yml/panel/new
'
}
|
${
'
config/prometheus/common_metrics.yml
'
}
${
'
/config%2Fprometheus%2Fcommon_metrics.yml/panel/new
'
}
|
${
'
config/prometheus/common_metrics.yml
'
}
`
(
`
(
'
"$path" renders page with dashboard "$currentDashboard"
'
,
({
path
,
currentDashboard
})
=>
{
'
displays the new panel page for path "$route" with route param $currentDashboard
'
,
const
wrapper
=
createWrapper
(
BASE_PATH
,
path
);
({
route
,
currentDashboard
})
=>
{
const
wrapper
=
createWrapper
(
BASE_PATH
,
route
);
expect
(
wrapper
.
vm
.
$route
.
params
.
dashboard
).
toBe
(
currentDashboard
);
expect
(
wrapper
.
find
(
PanelNewPage
).
exists
()).
toBe
(
true
);
expect
(
wrapper
.
vm
.
$route
.
params
.
dashboard
).
toBe
(
currentDashboard
);
});
expect
(
wrapper
.
find
(
PanelNewPage
).
exists
()).
toBe
(
true
);
},
);
});
});
});
});
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