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
20915674
Commit
20915674
authored
Jun 30, 2020
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove mock props data
Remove manually input mock data in favor of data from a fixture
parent
879d1679
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
20 deletions
+12
-20
spec/frontend/monitoring/mock_data.js
spec/frontend/monitoring/mock_data.js
+0
-17
spec/frontend/monitoring/pages/dashboard_page_spec.js
spec/frontend/monitoring/pages/dashboard_page_spec.js
+12
-3
No files found.
spec/frontend/monitoring/mock_data.js
View file @
20915674
...
...
@@ -5,23 +5,6 @@ import { TEST_HOST } from '../helpers/test_constants';
export
const
mockProjectDir
=
'
/frontend-fixtures/environments-project
'
;
export
const
mockApiEndpoint
=
`
${
TEST_HOST
}
/monitoring/mock`
;
export
const
propsData
=
{
hasMetrics
:
false
,
documentationPath
:
'
/path/to/docs
'
,
settingsPath
:
'
/path/to/settings
'
,
clustersPath
:
'
/path/to/clusters
'
,
tagsPath
:
'
/path/to/tags
'
,
defaultBranch
:
'
master
'
,
emptyGettingStartedSvgPath
:
'
/path/to/getting-started.svg
'
,
emptyLoadingSvgPath
:
'
/path/to/loading.svg
'
,
emptyNoDataSvgPath
:
'
/path/to/no-data.svg
'
,
emptyNoDataSmallSvgPath
:
'
/path/to/no-data-small.svg
'
,
emptyUnableToConnectSvgPath
:
'
/path/to/unable-to-connect.svg
'
,
customMetricsAvailable
:
false
,
customMetricsPath
:
''
,
validateQueryPath
:
''
,
};
export
const
customDashboardBasePath
=
'
.gitlab/dashboards
'
;
const
customDashboardsData
=
new
Array
(
30
).
fill
(
null
).
map
((
_
,
idx
)
=>
({
...
...
spec/frontend/monitoring/pages/dashboard_page_spec.js
View file @
20915674
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
DashboardPage
from
'
~/monitoring/pages/dashboard_page.vue
'
;
import
Dashboard
from
'
~/monitoring/components/dashboard.vue
'
;
import
{
propsData
}
from
'
../mock
_data
'
;
import
{
dashboardProps
}
from
'
../fixture
_data
'
;
describe
(
'
monitoring/pages/dashboard_page
'
,
()
=>
{
let
wrapper
;
...
...
@@ -28,9 +28,18 @@ describe('monitoring/pages/dashboard_page', () => {
});
it
(
'
renders the dashboard page with dashboard component
'
,
()
=>
{
buildWrapper
({
dashboardProps
:
propsData
});
buildWrapper
({
dashboardProps
});
const
allProps
=
{
...
dashboardProps
,
// default props values
rearrangePanelsAvailable
:
false
,
showHeader
:
true
,
showPanels
:
true
,
smallEmptyState
:
false
,
};
expect
(
findDashboardComponent
().
props
()).
toMatchObject
(
propsData
);
expect
(
findDashboardComponent
()).
toExist
();
expect
(
allProps
).
toMatchObject
(
findDashboardComponent
().
props
());
});
});
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