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
7993ea08
Commit
7993ea08
authored
Sep 28, 2020
by
Justin Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use it.each in item_caret_spec.js
parent
b46db83c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
spec/frontend/groups/components/item_caret_spec.js
spec/frontend/groups/components/item_caret_spec.js
+8
-10
No files found.
spec/frontend/groups/components/item_caret_spec.js
View file @
7993ea08
...
...
@@ -26,25 +26,23 @@ describe('ItemCaret', () => {
const
findGlIcon
=
()
=>
wrapper
.
find
(
GlIcon
);
describe
(
'
template
'
,
()
=>
{
it
(
'
should render
component template correctly
'
,
()
=>
{
it
(
'
renders
component template correctly
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
classes
()).
toContain
(
'
folder-caret
'
);
expect
(
findAllGlIcons
()).
toHaveLength
(
1
);
});
it
(
'
should render caret down icon if `isGroupOpen` prop is `true`
'
,
()
=>
{
it
.
each
`
isGroupOpen | icon
${
true
}
|
${
'
angle-down
'
}
${
false
}
|
${
'
angle-right
'
}
`
(
'
renders "$icon" icon when `isGroupOpen` is $isGroupOpen
'
,
({
isGroupOpen
,
icon
})
=>
{
createComponent
({
isGroupOpen
:
true
,
isGroupOpen
,
});
expect
(
findGlIcon
().
props
(
'
name
'
)).
toBe
(
'
angle-down
'
);
});
it
(
'
should render caret right icon if `isGroupOpen` prop is `false`
'
,
()
=>
{
createComponent
();
expect
(
findGlIcon
().
props
(
'
name
'
)).
toBe
(
'
angle-right
'
);
expect
(
findGlIcon
().
props
(
'
name
'
)).
toBe
(
icon
);
});
});
});
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