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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
d6e506dd
Commit
d6e506dd
authored
Jan 04, 2019
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made user_popovers_spec more stable on the value side
parent
4543ef09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
spec/javascripts/user_popovers_spec.js
spec/javascripts/user_popovers_spec.js
+10
-6
No files found.
spec/javascripts/user_popovers_spec.js
View file @
d6e506dd
...
...
@@ -30,7 +30,9 @@ describe('User Popovers', () => {
});
it
(
'
Should Show+Hide Popover on mouseenter and mouseleave
'
,
done
=>
{
triggerEvent
(
'
mouseenter
'
,
document
.
querySelector
(
selector
));
const
targetLink
=
document
.
querySelector
(
selector
);
const
{
userId
}
=
targetLink
.
dataset
;
triggerEvent
(
'
mouseenter
'
,
targetLink
);
setTimeout
(()
=>
{
const
shownPopover
=
document
.
querySelector
(
'
.popover
'
);
...
...
@@ -38,9 +40,9 @@ describe('User Popovers', () => {
expect
(
shownPopover
).
not
.
toBeNull
();
expect
(
shownPopover
.
innerHTML
).
toContain
(
dummyUser
.
name
);
expect
(
UsersCache
.
retrieveById
).
toHaveBeenCalledWith
(
'
58
'
);
expect
(
UsersCache
.
retrieveById
).
toHaveBeenCalledWith
(
userId
.
toString
()
);
triggerEvent
(
'
mouseleave
'
,
document
.
querySelector
(
selector
)
);
triggerEvent
(
'
mouseleave
'
,
targetLink
);
setTimeout
(()
=>
{
// After Mouse leave it should be hidden now
...
...
@@ -51,13 +53,15 @@ describe('User Popovers', () => {
});
it
(
'
Should Not show a popover on short mouse over
'
,
done
=>
{
triggerEvent
(
'
mouseenter
'
,
document
.
querySelector
(
selector
));
const
targetLink
=
document
.
querySelector
(
selector
);
const
{
userId
}
=
targetLink
.
dataset
;
triggerEvent
(
'
mouseenter
'
,
targetLink
);
setTimeout
(()
=>
{
expect
(
document
.
querySelector
(
'
.popover
'
)).
toBeNull
();
expect
(
UsersCache
.
retrieveById
).
not
.
toHaveBeenCalledWith
(
'
1
'
);
expect
(
UsersCache
.
retrieveById
).
not
.
toHaveBeenCalledWith
(
userId
.
toString
()
);
triggerEvent
(
'
mouseleave
'
,
document
.
querySelector
(
selector
)
);
triggerEvent
(
'
mouseleave
'
,
targetLink
);
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