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
5b117d80
Commit
5b117d80
authored
Jan 14, 2020
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create dropdownItemsCount() helper
parent
9875fbbe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
ee/spec/frontend/security_dashboard/components/filter_spec.js
...pec/frontend/security_dashboard/components/filter_spec.js
+4
-3
No files found.
ee/spec/frontend/security_dashboard/components/filter_spec.js
View file @
5b117d80
...
...
@@ -27,6 +27,7 @@ describe('Filter component', () => {
const
findSearchInput
=
()
=>
wrapper
.
find
({
ref
:
'
searchBox
'
}).
exists
()
&&
wrapper
.
find
({
ref
:
'
searchBox
'
}).
find
(
'
input
'
);
const
findDropdownToggle
=
()
=>
wrapper
.
find
(
'
.dropdown-toggle
'
);
const
dropdownItemsCount
=
()
=>
wrapper
.
findAll
(
'
.dropdown-item
'
).
length
;
function
isDropdownOpen
()
{
const
toggleButton
=
findDropdownToggle
();
...
...
@@ -59,7 +60,7 @@ describe('Filter component', () => {
});
it
(
'
should display all 8 severity options
'
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
.dropdown-item
'
).
length
).
toEqual
(
8
);
expect
(
dropdownItemsCount
()
).
toEqual
(
8
);
});
it
(
'
should display a check next to only the selected item
'
,
()
=>
{
...
...
@@ -118,7 +119,7 @@ describe('Filter component', () => {
});
it
(
`should show all projects`
,
()
=>
{
expect
(
wrapper
.
findAll
(
'
.dropdown-item
'
).
length
).
toBe
(
lots
);
expect
(
dropdownItemsCount
()
).
toBe
(
lots
);
});
it
(
'
should show only matching projects when a search term is entered
'
,
()
=>
{
...
...
@@ -126,7 +127,7 @@ describe('Filter component', () => {
input
.
vm
.
$el
.
value
=
'
0
'
;
input
.
vm
.
$el
.
dispatchEvent
(
new
Event
(
'
input
'
));
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
findAll
(
'
.dropdown-item
'
).
length
).
toBe
(
3
);
expect
(
dropdownItemsCount
()
).
toBe
(
3
);
});
});
});
...
...
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