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
dccde647
Commit
dccde647
authored
Jan 08, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GeoNodeSyncSettings Component tests
parent
49ae6cd8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
spec/javascripts/geo_nodes/components/geo_node_sync_settings_spec.js
...ripts/geo_nodes/components/geo_node_sync_settings_spec.js
+71
-0
No files found.
spec/javascripts/geo_nodes/components/geo_node_sync_settings_spec.js
0 → 100644
View file @
dccde647
import
Vue
from
'
vue
'
;
import
geoNodeSyncSettingsComponent
from
'
ee/geo_nodes/components/geo_node_sync_settings.vue
'
;
import
{
mockNodeDetails
}
from
'
../mock_data
'
;
import
mountComponent
from
'
../../helpers/vue_mount_component_helper
'
;
const
createComponent
=
(
namespaces
=
mockNodeDetails
.
namespaces
,
lastEvent
=
mockNodeDetails
.
lastEvent
,
cursorLastEvent
=
mockNodeDetails
.
cursorLastEvent
)
=>
{
const
Component
=
Vue
.
extend
(
geoNodeSyncSettingsComponent
);
return
mountComponent
(
Component
,
{
namespaces
,
lastEvent
,
cursorLastEvent
,
});
};
describe
(
'
GeoNodeSyncSettingsComponent
'
,
()
=>
{
describe
(
'
computed
'
,
()
=>
{
describe
(
'
syncType
'
,
()
=>
{
it
(
'
returns string representing sync type
'
,
()
=>
{
const
vm
=
createComponent
();
expect
(
vm
.
syncType
).
toBe
(
'
Selective
'
);
vm
.
$destroy
();
});
});
});
describe
(
'
methods
'
,
()
=>
{
let
vm
;
beforeEach
(()
=>
{
vm
=
createComponent
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
lagInSeconds
'
,
()
=>
{
it
(
'
returns string representing sync type
'
,
()
=>
{
expect
(
vm
.
lagInSeconds
(
1511255200
,
1511255450
)).
toBe
(
250
);
});
});
describe
(
'
statusIcon
'
,
()
=>
{
it
(
'
returns string representing sync status icon
'
,
()
=>
{
expect
(
vm
.
statusIcon
(
250
)).
toBe
(
'
retry
'
);
expect
(
vm
.
statusIcon
(
3500
)).
toBe
(
'
warning
'
);
expect
(
vm
.
statusIcon
(
4000
)).
toBe
(
'
status_failed
'
);
});
});
describe
(
'
statusEventInfo
'
,
()
=>
{
it
(
'
returns string representing status event info
'
,
()
=>
{
expect
(
vm
.
statusEventInfo
(
3
,
3
,
250
)).
toBe
(
'
4 minutes 10 seconds (0 events)
'
);
});
});
describe
(
'
statusTooltip
'
,
()
=>
{
it
(
'
returns string representing status lag message
'
,
()
=>
{
expect
(
vm
.
statusTooltip
(
250
)).
toBe
(
''
);
expect
(
vm
.
statusTooltip
(
1000
)).
toBe
(
'
Node is slow, overloaded, or it just recovered after an outage.
'
);
expect
(
vm
.
statusTooltip
(
4000
)).
toBe
(
'
Node is failing or broken.
'
);
});
});
});
});
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