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
fe60886a
Commit
fe60886a
authored
Apr 24, 2018
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some karma specs
parent
7fe9102a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+1
-1
app/assets/javascripts/vue_shared/directives/popover.js
app/assets/javascripts/vue_shared/directives/popover.js
+1
-1
spec/javascripts/boards/issue_card_spec.js
spec/javascripts/boards/issue_card_spec.js
+5
-5
spec/javascripts/gl_dropdown_spec.js
spec/javascripts/gl_dropdown_spec.js
+6
-6
No files found.
app/assets/javascripts/main.js
View file @
fe60886a
...
...
@@ -48,7 +48,7 @@ document.addEventListener('beforeunload', () => {
// Close any open tooltips
$
(
'
.has-tooltip, [data-toggle="tooltip"]
'
).
tooltip
(
'
dispose
'
);
// Close any open popover
$
(
'
[data-toggle="popover"]
'
).
popover
(
'
d
estroy
'
);
$
(
'
[data-toggle="popover"]
'
).
popover
(
'
d
ispose
'
);
});
window
.
addEventListener
(
'
hashchange
'
,
handleLocationHash
);
...
...
app/assets/javascripts/vue_shared/directives/popover.js
View file @
fe60886a
...
...
@@ -17,6 +17,6 @@ export default {
},
unbind
(
el
)
{
$
(
el
).
popover
(
'
d
estroy
'
);
$
(
el
).
popover
(
'
d
ispose
'
);
},
};
spec/javascripts/boards/issue_card_spec.js
View file @
fe60886a
...
...
@@ -248,13 +248,13 @@ describe('Issue card component', () => {
it
(
'
renders list label
'
,
()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
length
,
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
length
,
).
toBe
(
2
);
});
it
(
'
renders label
'
,
()
=>
{
const
nodes
=
[];
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
forEach
((
label
)
=>
{
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
forEach
((
label
)
=>
{
nodes
.
push
(
label
.
title
);
});
...
...
@@ -265,13 +265,13 @@ describe('Issue card component', () => {
it
(
'
sets label description as title
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.
label
'
).
getAttribute
(
'
title
'
),
component
.
$el
.
querySelector
(
'
.
badge
'
).
getAttribute
(
'
title
'
),
).
toContain
(
label1
.
description
);
});
it
(
'
sets background color of button
'
,
()
=>
{
const
nodes
=
[];
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
forEach
((
label
)
=>
{
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
forEach
((
label
)
=>
{
nodes
.
push
(
label
.
style
.
backgroundColor
);
});
...
...
@@ -288,7 +288,7 @@ describe('Issue card component', () => {
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
length
,
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
length
,
).
toBe
(
2
);
expect
(
component
.
$el
.
textContent
,
...
...
spec/javascripts/gl_dropdown_spec.js
View file @
fe60886a
...
...
@@ -71,9 +71,9 @@ describe('glDropdown', function describeDropdown() {
it
(
'
should open on click
'
,
()
=>
{
initDropDown
.
call
(
this
,
false
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
show
'
);
this
.
dropdownButtonElement
.
click
();
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
show
'
);
});
it
(
'
escapes HTML as text
'
,
()
=>
{
...
...
@@ -135,12 +135,12 @@ describe('glDropdown', function describeDropdown() {
});
it
(
'
should click the selected item on ENTER keypress
'
,
()
=>
{
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
show
'
);
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
(
this
.
projectsData
.
length
-
1
))
+
0
;
navigateWithKeys
(
'
down
'
,
randomIndex
,
()
=>
{
spyOn
(
urlUtils
,
'
visitUrl
'
).
and
.
stub
();
navigateWithKeys
(
'
enter
'
,
null
,
()
=>
{
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
show
'
);
const
link
=
$
(
`
${
ITEM_SELECTOR
}
:eq(
${
randomIndex
}
) a`
,
this
.
$dropdownMenuElement
);
expect
(
link
).
toHaveClass
(
'
is-active
'
);
const
linkedLocation
=
link
.
attr
(
'
href
'
);
...
...
@@ -150,13 +150,13 @@ describe('glDropdown', function describeDropdown() {
});
it
(
'
should close on ESC keypress
'
,
()
=>
{
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
show
'
);
this
.
dropdownContainerElement
.
trigger
({
type
:
'
keyup
'
,
which
:
ARROW_KEYS
.
ESC
,
keyCode
:
ARROW_KEYS
.
ESC
});
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
show
'
);
});
});
...
...
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