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
59153b50
Commit
59153b50
authored
Jan 08, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo Nodes Store tests
parent
50347ca3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/javascripts/geo_nodes/store/geo_nodes_store_spec.js
spec/javascripts/geo_nodes/store/geo_nodes_store_spec.js
+44
-0
No files found.
spec/javascripts/geo_nodes/store/geo_nodes_store_spec.js
0 → 100644
View file @
59153b50
import
GeoNodesStore
from
'
ee/geo_nodes/store/geo_nodes_store
'
;
import
{
mockNodes
,
rawMockNodeDetails
,
mockNodeDetails
}
from
'
../mock_data
'
;
describe
(
'
GeoNodesStore
'
,
()
=>
{
let
store
;
beforeEach
(()
=>
{
store
=
new
GeoNodesStore
(
mockNodeDetails
.
primaryVersion
,
mockNodeDetails
.
primaryRevision
);
});
describe
(
'
constructor
'
,
()
=>
{
it
(
'
initializes default state
'
,
()
=>
{
expect
(
typeof
store
.
state
).
toBe
(
'
object
'
);
expect
(
Array
.
isArray
(
store
.
state
.
nodes
)).
toBeTruthy
();
expect
(
typeof
store
.
state
.
nodeDetails
).
toBe
(
'
object
'
);
expect
(
store
.
state
.
primaryVersion
).
toBe
(
mockNodeDetails
.
primaryVersion
);
expect
(
store
.
state
.
primaryRevision
).
toBe
(
mockNodeDetails
.
primaryRevision
);
});
});
describe
(
'
setNodes
'
,
()
=>
{
it
(
'
sets nodes list to state
'
,
()
=>
{
store
.
setNodes
(
mockNodes
);
expect
(
store
.
getNodes
()).
toBe
(
mockNodes
);
});
});
describe
(
'
setNodeDetails
'
,
()
=>
{
it
(
'
sets node details to state
'
,
()
=>
{
store
.
setNodeDetails
(
2
,
rawMockNodeDetails
);
expect
(
typeof
store
.
getNodeDetails
(
2
)).
toBe
(
'
object
'
);
});
});
describe
(
'
formatNodeDetails
'
,
()
=>
{
it
(
'
returns formatted raw node details object
'
,
()
=>
{
const
nodeDetails
=
GeoNodesStore
.
formatNodeDetails
(
rawMockNodeDetails
);
expect
(
nodeDetails
.
healthStatus
).
toBe
(
rawMockNodeDetails
.
health_status
);
expect
(
nodeDetails
.
replicationSlotWAL
)
.
toBe
(
rawMockNodeDetails
.
replication_slots_max_retained_wal_bytes
);
});
});
});
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