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', () => {
...
@@ -13,50 +13,50 @@ describe('popover', () => {
popover
:
()
=>
{},
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
toggleClass
:
()
=>
{},
};
};
expect
(
togglePopover
.
call
(
context
,
true
)).
toEqual
(
true
);
expect
(
togglePopover
.
call
(
context
,
true
)).
toEqual
(
true
);
});
});
it
(
'
returns false when popover is already shown
'
,
()
=>
{
it
(
'
returns false when popover is already shown
'
,
()
=>
{
const
context
=
{
const
context
=
{
hasClass
:
()
=>
true
,
hasClass
:
()
=>
true
,
};
};
expect
(
togglePopover
.
call
(
context
,
true
)).
toEqual
(
false
);
expect
(
togglePopover
.
call
(
context
,
true
)).
toEqual
(
false
);
});
});
it
(
'
shows popover
'
,
(
done
)
=>
{
it
(
'
shows popover
'
,
(
done
)
=>
{
const
context
=
{
const
context
=
{
hasClass
:
()
=>
false
,
hasClass
:
()
=>
false
,
popover
:
()
=>
{},
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
toggleClass
:
()
=>
{},
};
};
spyOn
(
context
,
'
popover
'
).
and
.
callFake
((
method
)
=>
{
spyOn
(
context
,
'
popover
'
).
and
.
callFake
((
method
)
=>
{
expect
(
method
).
toEqual
(
'
show
'
);
expect
(
method
).
toEqual
(
'
show
'
);
done
();
done
();
});
});
togglePopover
.
call
(
context
,
true
);
togglePopover
.
call
(
context
,
true
);
});
});
it
(
'
adds disable-animation and js-popover-show class
'
,
(
done
)
=>
{
it
(
'
adds disable-animation and js-popover-show class
'
,
(
done
)
=>
{
const
context
=
{
const
context
=
{
hasClass
:
()
=>
false
,
hasClass
:
()
=>
false
,
popover
:
()
=>
{},
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
toggleClass
:
()
=>
{},
};
};
spyOn
(
context
,
'
toggleClass
'
).
and
.
callFake
((
classNames
,
show
)
=>
{
spyOn
(
context
,
'
toggleClass
'
).
and
.
callFake
((
classNames
,
show
)
=>
{
expect
(
classNames
).
toEqual
(
'
disable-animation js-popover-show
'
);
expect
(
classNames
).
toEqual
(
'
disable-animation js-popover-show
'
);
expect
(
show
).
toEqual
(
true
);
expect
(
show
).
toEqual
(
true
);
done
();
done
();
});
});
togglePopover
.
call
(
context
,
true
);
togglePopover
.
call
(
context
,
true
);
});
});
});
});
describe
(
'
togglePopover(false)
'
,
()
=>
{
describe
(
'
togglePopover(false)
'
,
()
=>
{
it
(
'
returns true when popover is hidden
'
,
()
=>
{
it
(
'
returns true when popover is hidden
'
,
()
=>
{
const
context
=
{
const
context
=
{
...
@@ -64,46 +64,46 @@ describe('popover', () => {
...
@@ -64,46 +64,46 @@ describe('popover', () => {
popover
:
()
=>
{},
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
toggleClass
:
()
=>
{},
};
};
expect
(
togglePopover
.
call
(
context
,
false
)).
toEqual
(
true
);
expect
(
togglePopover
.
call
(
context
,
false
)).
toEqual
(
true
);
});
});
it
(
'
returns false when popover is already hidden
'
,
()
=>
{
it
(
'
returns false when popover is already hidden
'
,
()
=>
{
const
context
=
{
const
context
=
{
hasClass
:
()
=>
false
,
hasClass
:
()
=>
false
,
};
};
expect
(
togglePopover
.
call
(
context
,
false
)).
toEqual
(
false
);
expect
(
togglePopover
.
call
(
context
,
false
)).
toEqual
(
false
);
});
});
it
(
'
hides popover
'
,
(
done
)
=>
{
it
(
'
hides popover
'
,
(
done
)
=>
{
const
context
=
{
const
context
=
{
hasClass
:
()
=>
true
,
hasClass
:
()
=>
true
,
popover
:
()
=>
{},
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
toggleClass
:
()
=>
{},
};
};
spyOn
(
context
,
'
popover
'
).
and
.
callFake
((
method
)
=>
{
spyOn
(
context
,
'
popover
'
).
and
.
callFake
((
method
)
=>
{
expect
(
method
).
toEqual
(
'
hide
'
);
expect
(
method
).
toEqual
(
'
hide
'
);
done
();
done
();
});
});
togglePopover
.
call
(
context
,
false
);
togglePopover
.
call
(
context
,
false
);
});
});
it
(
'
removes disable-animation and js-popover-show class
'
,
(
done
)
=>
{
it
(
'
removes disable-animation and js-popover-show class
'
,
(
done
)
=>
{
const
context
=
{
const
context
=
{
hasClass
:
()
=>
true
,
hasClass
:
()
=>
true
,
popover
:
()
=>
{},
popover
:
()
=>
{},
toggleClass
:
()
=>
{},
toggleClass
:
()
=>
{},
};
};
spyOn
(
context
,
'
toggleClass
'
).
and
.
callFake
((
classNames
,
show
)
=>
{
spyOn
(
context
,
'
toggleClass
'
).
and
.
callFake
((
classNames
,
show
)
=>
{
expect
(
classNames
).
toEqual
(
'
disable-animation js-popover-show
'
);
expect
(
classNames
).
toEqual
(
'
disable-animation js-popover-show
'
);
expect
(
show
).
toEqual
(
false
);
expect
(
show
).
toEqual
(
false
);
done
();
done
();
});
});
togglePopover
.
call
(
context
,
false
);
togglePopover
.
call
(
context
,
false
);
});
});
});
});
...
@@ -158,4 +158,4 @@ describe('popover', () => {
...
@@ -158,4 +158,4 @@ describe('popover', () => {
expect
(
spy
).
not
.
toHaveBeenCalled
();
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