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
7076e34a
Commit
7076e34a
authored
May 18, 2018
by
Kushal Pandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add tests for node details methods
parent
96590287
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
4 deletions
+62
-4
spec/javascripts/geo_nodes/components/node_detail_sections/node_details_section_verification_spec.js
...detail_sections/node_details_section_verification_spec.js
+48
-0
spec/javascripts/geo_nodes/mock_data.js
spec/javascripts/geo_nodes/mock_data.js
+14
-4
No files found.
spec/javascripts/geo_nodes/components/node_detail_sections/node_details_section_verification_spec.js
View file @
7076e34a
...
...
@@ -55,6 +55,54 @@ describe('NodeDetailsSectionVerification', () => {
});
});
describe
(
'
methods
'
,
()
=>
{
describe
(
'
getPrimaryNodeDetailItems
'
,
()
=>
{
const
primaryItems
=
[
{
title
:
'
Repository checksum progress
'
,
valueProp
:
'
repositoriesChecksummed
'
,
},
{
title
:
'
Wiki checksum progress
'
,
valueProp
:
'
wikisChecksummed
'
,
},
{
title
:
'
Replication slots
'
,
valueProp
:
'
replicationSlots
'
,
},
];
it
(
'
returns array containing items to show under primary node
'
,
()
=>
{
const
actualPrimaryItems
=
vm
.
getPrimaryNodeDetailItems
();
primaryItems
.
forEach
((
item
,
index
)
=>
{
expect
(
actualPrimaryItems
[
index
].
itemTitle
).
toBe
(
item
.
title
);
expect
(
actualPrimaryItems
[
index
].
itemValue
).
toBe
(
mockNodeDetails
[
item
.
valueProp
]);
});
});
});
describe
(
'
getSecondaryNodeDetailItems
'
,
()
=>
{
const
secondaryItems
=
[
{
title
:
'
Repository verification progress
'
,
valueProp
:
'
verifiedRepositories
'
,
},
{
title
:
'
Wiki verification progress
'
,
valueProp
:
'
verifiedWikis
'
,
},
];
it
(
'
returns array containing items to show under secondary node
'
,
()
=>
{
const
actualSecondaryItems
=
vm
.
getSecondaryNodeDetailItems
();
secondaryItems
.
forEach
((
item
,
index
)
=>
{
expect
(
actualSecondaryItems
[
index
].
itemTitle
).
toBe
(
item
.
title
);
expect
(
actualSecondaryItems
[
index
].
itemValue
).
toBe
(
mockNodeDetails
[
item
.
valueProp
]);
});
});
});
});
describe
(
'
template
'
,
()
=>
{
it
(
'
renders component container element
'
,
()
=>
{
expect
(
vm
.
$el
.
classList
.
contains
(
'
verification-section
'
)).
toBe
(
true
);
...
...
spec/javascripts/geo_nodes/mock_data.js
View file @
7076e34a
...
...
@@ -182,14 +182,24 @@ export const mockNodeDetails = {
successCount
:
0
,
failureCount
:
0
,
},
repositoriesChecksummed
:
{
totalCount
:
12
,
successCount
:
12
,
failureCount
:
0
,
},
wikisChecksummed
:
{
totalCount
:
12
,
successCount
:
12
,
failureCount
:
0
,
},
verifiedRepositories
:
{
totalCount
:
0
,
successCount
:
0
,
totalCount
:
12
,
successCount
:
12
,
failureCount
:
0
,
},
verifiedWikis
:
{
totalCount
:
0
,
successCount
:
0
,
totalCount
:
12
,
successCount
:
12
,
failureCount
:
0
,
},
lastEvent
:
{
...
...
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