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
e108a07b
Commit
e108a07b
authored
Mar 19, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix tests for dahboard.vue
parent
fc217415
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
34 deletions
+13
-34
spec/javascripts/monitoring/dashboard_spec.js
spec/javascripts/monitoring/dashboard_spec.js
+1
-0
spec/javascripts/monitoring/dashboard_state_spec.js
spec/javascripts/monitoring/dashboard_state_spec.js
+12
-34
No files found.
spec/javascripts/monitoring/dashboard_spec.js
View file @
e108a07b
...
...
@@ -18,6 +18,7 @@ describe('Dashboard', () => {
deploymentEndpoint
:
null
,
emptyGettingStartedSvgPath
:
'
/path/to/getting-started.svg
'
,
emptyLoadingSvgPath
:
'
/path/to/loading.svg
'
,
emptyNoDataSvgPath
:
'
/path/to/no-data.svg
'
,
emptyUnableToConnectSvgPath
:
'
/path/to/unable-to-connect.svg
'
,
};
...
...
spec/javascripts/monitoring/dashboard_state_spec.js
View file @
e108a07b
...
...
@@ -2,13 +2,22 @@ import Vue from 'vue';
import
EmptyState
from
'
~/monitoring/components/empty_state.vue
'
;
import
{
statePaths
}
from
'
./mock_data
'
;
const
createComponent
=
(
propsData
)
=>
{
function
createComponent
(
props
)
{
const
Component
=
Vue
.
extend
(
EmptyState
);
return
new
Component
({
propsData
,
propsData
:
{
...
props
,
settingsPath
:
statePaths
.
settingsPath
,
clustersPath
:
statePaths
.
clustersPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
/path/to/getting-started.svg
'
,
emptyLoadingSvgPath
:
'
/path/to/loading.svg
'
,
emptyNoDataSvgPath
:
'
/path/to/no-data.svg
'
,
emptyUnableToConnectSvgPath
:
'
/path/to/unable-to-connect.svg
'
,
},
}).
$mount
();
}
;
}
function
getTextFromNode
(
component
,
selector
)
{
return
component
.
$el
.
querySelector
(
selector
).
firstChild
.
nodeValue
.
trim
();
...
...
@@ -19,11 +28,6 @@ describe('EmptyState', () => {
it
(
'
currentState
'
,
()
=>
{
const
component
=
createComponent
({
selectedState
:
'
gettingStarted
'
,
settingsPath
:
statePaths
.
settingsPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
foo
'
,
emptyLoadingSvgPath
:
'
foo
'
,
emptyUnableToConnectSvgPath
:
'
foo
'
,
});
expect
(
component
.
currentState
).
toBe
(
component
.
states
.
gettingStarted
);
...
...
@@ -32,11 +36,6 @@ describe('EmptyState', () => {
it
(
'
showButtonDescription returns a description with a link for the unableToConnect state
'
,
()
=>
{
const
component
=
createComponent
({
selectedState
:
'
unableToConnect
'
,
settingsPath
:
statePaths
.
settingsPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
foo
'
,
emptyLoadingSvgPath
:
'
foo
'
,
emptyUnableToConnectSvgPath
:
'
foo
'
,
});
expect
(
component
.
showButtonDescription
).
toEqual
(
true
);
...
...
@@ -45,11 +44,6 @@ describe('EmptyState', () => {
it
(
'
showButtonDescription returns the description without a link for any other state
'
,
()
=>
{
const
component
=
createComponent
({
selectedState
:
'
loading
'
,
settingsPath
:
statePaths
.
settingsPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
foo
'
,
emptyLoadingSvgPath
:
'
foo
'
,
emptyUnableToConnectSvgPath
:
'
foo
'
,
});
expect
(
component
.
showButtonDescription
).
toEqual
(
false
);
...
...
@@ -59,12 +53,6 @@ describe('EmptyState', () => {
it
(
'
should show the gettingStarted state
'
,
()
=>
{
const
component
=
createComponent
({
selectedState
:
'
gettingStarted
'
,
settingsPath
:
statePaths
.
settingsPath
,
clustersPath
:
statePaths
.
clustersPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
foo
'
,
emptyLoadingSvgPath
:
'
foo
'
,
emptyUnableToConnectSvgPath
:
'
foo
'
,
});
expect
(
component
.
$el
.
querySelector
(
'
svg
'
)).
toBeDefined
();
...
...
@@ -76,11 +64,6 @@ describe('EmptyState', () => {
it
(
'
should show the loading state
'
,
()
=>
{
const
component
=
createComponent
({
selectedState
:
'
loading
'
,
settingsPath
:
statePaths
.
settingsPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
foo
'
,
emptyLoadingSvgPath
:
'
foo
'
,
emptyUnableToConnectSvgPath
:
'
foo
'
,
});
expect
(
component
.
$el
.
querySelector
(
'
svg
'
)).
toBeDefined
();
...
...
@@ -92,11 +75,6 @@ describe('EmptyState', () => {
it
(
'
should show the unableToConnect state
'
,
()
=>
{
const
component
=
createComponent
({
selectedState
:
'
unableToConnect
'
,
settingsPath
:
statePaths
.
settingsPath
,
documentationPath
:
statePaths
.
documentationPath
,
emptyGettingStartedSvgPath
:
'
foo
'
,
emptyLoadingSvgPath
:
'
foo
'
,
emptyUnableToConnectSvgPath
:
'
foo
'
,
});
expect
(
component
.
$el
.
querySelector
(
'
svg
'
)).
toBeDefined
();
...
...
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