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
c3414e8f
Commit
c3414e8f
authored
Jan 08, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GeoNodeHealthStatus Component tests
parent
e1b217fb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
0 deletions
+61
-0
spec/javascripts/geo_nodes/components/geo_node_health_status_spec.js
...ripts/geo_nodes/components/geo_node_health_status_spec.js
+61
-0
No files found.
spec/javascripts/geo_nodes/components/geo_node_health_status_spec.js
0 → 100644
View file @
c3414e8f
import
Vue
from
'
vue
'
;
import
geoNodeHealthStatusComponent
from
'
ee/geo_nodes/components/geo_node_health_status.vue
'
;
import
{
mockNodeDetails
}
from
'
../mock_data
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
(
status
=
mockNodeDetails
.
health
)
=>
{
const
Component
=
Vue
.
extend
(
geoNodeHealthStatusComponent
);
return
mountComponent
(
Component
,
{
status
,
});
};
describe
(
'
GeoNodeHealthStatusComponent
'
,
()
=>
{
describe
(
'
computed
'
,
()
=>
{
describe
(
'
healthCssClass
'
,
()
=>
{
it
(
'
returns CSS class representing `status` prop value
'
,
()
=>
{
const
vm
=
createComponent
(
'
Healthy
'
);
expect
(
vm
.
healthCssClass
).
toBe
(
'
geo-node-healthy
'
);
vm
.
$destroy
();
});
});
describe
(
'
statusIconName
'
,
()
=>
{
it
(
'
returns icon name representing `status` prop value
'
,
()
=>
{
let
vm
=
createComponent
(
'
Healthy
'
);
expect
(
vm
.
statusIconName
).
toBe
(
'
status_success
'
);
vm
.
$destroy
();
vm
=
createComponent
(
'
Unhealthy
'
);
expect
(
vm
.
statusIconName
).
toBe
(
'
status_failed
'
);
vm
.
$destroy
();
vm
=
createComponent
(
'
Disabled
'
);
expect
(
vm
.
statusIconName
).
toBe
(
'
status_canceled
'
);
vm
.
$destroy
();
vm
=
createComponent
(
'
Unknown
'
);
expect
(
vm
.
statusIconName
).
toBe
(
'
status_warning
'
);
vm
.
$destroy
();
vm
=
createComponent
(
'
Offline
'
);
expect
(
vm
.
statusIconName
).
toBe
(
'
status_canceled
'
);
vm
.
$destroy
();
});
});
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders container elements correctly
'
,
()
=>
{
const
vm
=
createComponent
(
'
Healthy
'
);
expect
(
vm
.
$el
.
classList
.
contains
(
'
node-detail-value
'
,
'
node-health-status
'
,
'
geo-node-healthy
'
)).
toBeTruthy
();
expect
(
vm
.
$el
.
querySelectorAll
(
'
svg
'
).
length
).
not
.
toBe
(
0
);
expect
(
vm
.
$el
.
querySelector
(
'
svg use
'
).
getAttribute
(
'
xlink:href
'
)).
toContain
(
'
#status_success
'
);
expect
(
vm
.
$el
.
querySelector
(
'
.status-text
'
).
innerText
.
trim
()).
toBe
(
'
Healthy
'
);
vm
.
$destroy
();
});
});
});
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