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
9875fbbe
Commit
9875fbbe
authored
Jan 13, 2020
by
Paul Gascou-Vaillancourt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use promise-based nextTick
parent
3e0473c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
ee/spec/frontend/security_dashboard/components/filter_spec.js
...pec/frontend/security_dashboard/components/filter_spec.js
+8
-11
No files found.
ee/spec/frontend/security_dashboard/components/filter_spec.js
View file @
9875fbbe
...
...
@@ -86,21 +86,19 @@ describe('Filter component', () => {
});
});
it
(
'
should keep the menu open after clicking on an item
'
,
done
=>
{
it
(
'
should keep the menu open after clicking on an item
'
,
()
=>
{
expect
(
isDropdownOpen
()).
toBe
(
true
);
wrapper
.
find
(
'
.dropdown-item
'
).
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
isDropdownOpen
()).
toBe
(
true
);
done
();
});
});
it
(
'
should close the menu when the close button is clicked
'
,
done
=>
{
it
(
'
should close the menu when the close button is clicked
'
,
()
=>
{
expect
(
isDropdownOpen
()).
toBe
(
true
);
wrapper
.
find
({
ref
:
'
close
'
}).
trigger
(
'
click
'
);
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
isDropdownOpen
()).
toBe
(
false
);
done
();
});
});
});
...
...
@@ -109,10 +107,10 @@ describe('Filter component', () => {
describe
(
'
Project
'
,
()
=>
{
describe
(
'
when there are lots of projects
'
,
()
=>
{
const
lots
=
30
;
beforeEach
(
done
=>
{
beforeEach
(
()
=>
{
createWrapper
({
filterId
:
'
project_id
'
,
dashboardDocumentation
:
''
});
setProjectsCount
(
lots
);
wrapper
.
vm
.
$nextTick
(
done
);
return
wrapper
.
vm
.
$nextTick
(
);
});
it
(
'
should display a search box
'
,
()
=>
{
...
...
@@ -123,13 +121,12 @@ describe('Filter component', () => {
expect
(
wrapper
.
findAll
(
'
.dropdown-item
'
).
length
).
toBe
(
lots
);
});
it
(
'
should show only matching projects when a search term is entered
'
,
done
=>
{
it
(
'
should show only matching projects when a search term is entered
'
,
()
=>
{
const
input
=
findSearchInput
();
input
.
vm
.
$el
.
value
=
'
0
'
;
input
.
vm
.
$el
.
dispatchEvent
(
new
Event
(
'
input
'
));
wrapper
.
vm
.
$nextTick
(()
=>
{
return
wrapper
.
vm
.
$nextTick
().
then
(()
=>
{
expect
(
wrapper
.
findAll
(
'
.dropdown-item
'
).
length
).
toBe
(
3
);
done
();
});
});
});
...
...
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