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
e65c7aa8
Commit
e65c7aa8
authored
Apr 03, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
eslint-fix
parent
597810df
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
20 deletions
+20
-20
spec/javascripts/shared/popover.js
spec/javascripts/shared/popover.js
+20
-20
No files found.
spec/javascripts/shared/popover.js
View file @
e65c7aa8
...
...
@@ -13,50 +13,50 @@ describe('popover', () => {
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
};
expect
(
togglePopover
.
call
(
context
,
true
)).
toEqual
(
true
);
});
it
(
'
returns false when popover is already shown
'
,
()
=>
{
const
context
=
{
hasClass
:
()
=>
true
,
};
expect
(
togglePopover
.
call
(
context
,
true
)).
toEqual
(
false
);
});
it
(
'
shows popover
'
,
(
done
)
=>
{
const
context
=
{
hasClass
:
()
=>
false
,
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
};
spyOn
(
context
,
'
popover
'
).
and
.
callFake
((
method
)
=>
{
expect
(
method
).
toEqual
(
'
show
'
);
done
();
});
togglePopover
.
call
(
context
,
true
);
});
it
(
'
adds disable-animation and js-popover-show class
'
,
(
done
)
=>
{
const
context
=
{
hasClass
:
()
=>
false
,
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
};
spyOn
(
context
,
'
toggleClass
'
).
and
.
callFake
((
classNames
,
show
)
=>
{
expect
(
classNames
).
toEqual
(
'
disable-animation js-popover-show
'
);
expect
(
show
).
toEqual
(
true
);
done
();
});
togglePopover
.
call
(
context
,
true
);
});
});
describe
(
'
togglePopover(false)
'
,
()
=>
{
it
(
'
returns true when popover is hidden
'
,
()
=>
{
const
context
=
{
...
...
@@ -64,46 +64,46 @@ describe('popover', () => {
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
};
expect
(
togglePopover
.
call
(
context
,
false
)).
toEqual
(
true
);
});
it
(
'
returns false when popover is already hidden
'
,
()
=>
{
const
context
=
{
hasClass
:
()
=>
false
,
};
expect
(
togglePopover
.
call
(
context
,
false
)).
toEqual
(
false
);
});
it
(
'
hides popover
'
,
(
done
)
=>
{
const
context
=
{
hasClass
:
()
=>
true
,
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
};
spyOn
(
context
,
'
popover
'
).
and
.
callFake
((
method
)
=>
{
expect
(
method
).
toEqual
(
'
hide
'
);
done
();
});
togglePopover
.
call
(
context
,
false
);
});
it
(
'
removes disable-animation and js-popover-show class
'
,
(
done
)
=>
{
const
context
=
{
hasClass
:
()
=>
true
,
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
};
spyOn
(
context
,
'
toggleClass
'
).
and
.
callFake
((
classNames
,
show
)
=>
{
expect
(
classNames
).
toEqual
(
'
disable-animation js-popover-show
'
);
expect
(
show
).
toEqual
(
false
);
done
();
});
togglePopover
.
call
(
context
,
false
);
});
});
...
...
@@ -158,4 +158,4 @@ describe('popover', () => {
expect
(
spy
).
not
.
toHaveBeenCalled
();
});
});
});
\ No newline at end of file
});
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