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
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', () => {
...
@@ -48,7 +48,7 @@ document.addEventListener('beforeunload', () => {
// Close any open tooltips
// Close any open tooltips
$
(
'
.has-tooltip, [data-toggle="tooltip"]
'
).
tooltip
(
'
dispose
'
);
$
(
'
.has-tooltip, [data-toggle="tooltip"]
'
).
tooltip
(
'
dispose
'
);
// Close any open popover
// Close any open popover
$
(
'
[data-toggle="popover"]
'
).
popover
(
'
d
estroy
'
);
$
(
'
[data-toggle="popover"]
'
).
popover
(
'
d
ispose
'
);
});
});
window
.
addEventListener
(
'
hashchange
'
,
handleLocationHash
);
window
.
addEventListener
(
'
hashchange
'
,
handleLocationHash
);
...
...
app/assets/javascripts/vue_shared/directives/popover.js
View file @
fe60886a
...
@@ -17,6 +17,6 @@ export default {
...
@@ -17,6 +17,6 @@ export default {
},
},
unbind
(
el
)
{
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', () => {
...
@@ -248,13 +248,13 @@ describe('Issue card component', () => {
it
(
'
renders list label
'
,
()
=>
{
it
(
'
renders list label
'
,
()
=>
{
expect
(
expect
(
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
length
,
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
length
,
).
toBe
(
2
);
).
toBe
(
2
);
});
});
it
(
'
renders label
'
,
()
=>
{
it
(
'
renders label
'
,
()
=>
{
const
nodes
=
[];
const
nodes
=
[];
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
forEach
((
label
)
=>
{
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
forEach
((
label
)
=>
{
nodes
.
push
(
label
.
title
);
nodes
.
push
(
label
.
title
);
});
});
...
@@ -265,13 +265,13 @@ describe('Issue card component', () => {
...
@@ -265,13 +265,13 @@ describe('Issue card component', () => {
it
(
'
sets label description as title
'
,
()
=>
{
it
(
'
sets label description as title
'
,
()
=>
{
expect
(
expect
(
component
.
$el
.
querySelector
(
'
.
label
'
).
getAttribute
(
'
title
'
),
component
.
$el
.
querySelector
(
'
.
badge
'
).
getAttribute
(
'
title
'
),
).
toContain
(
label1
.
description
);
).
toContain
(
label1
.
description
);
});
});
it
(
'
sets background color of button
'
,
()
=>
{
it
(
'
sets background color of button
'
,
()
=>
{
const
nodes
=
[];
const
nodes
=
[];
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
forEach
((
label
)
=>
{
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
forEach
((
label
)
=>
{
nodes
.
push
(
label
.
style
.
backgroundColor
);
nodes
.
push
(
label
.
style
.
backgroundColor
);
});
});
...
@@ -288,7 +288,7 @@ describe('Issue card component', () => {
...
@@ -288,7 +288,7 @@ describe('Issue card component', () => {
Vue
.
nextTick
()
Vue
.
nextTick
()
.
then
(()
=>
{
.
then
(()
=>
{
expect
(
expect
(
component
.
$el
.
querySelectorAll
(
'
.
label
'
).
length
,
component
.
$el
.
querySelectorAll
(
'
.
badge
'
).
length
,
).
toBe
(
2
);
).
toBe
(
2
);
expect
(
expect
(
component
.
$el
.
textContent
,
component
.
$el
.
textContent
,
...
...
spec/javascripts/gl_dropdown_spec.js
View file @
fe60886a
...
@@ -71,9 +71,9 @@ describe('glDropdown', function describeDropdown() {
...
@@ -71,9 +71,9 @@ describe('glDropdown', function describeDropdown() {
it
(
'
should open on click
'
,
()
=>
{
it
(
'
should open on click
'
,
()
=>
{
initDropDown
.
call
(
this
,
false
);
initDropDown
.
call
(
this
,
false
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
show
'
);
this
.
dropdownButtonElement
.
click
();
this
.
dropdownButtonElement
.
click
();
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
show
'
);
});
});
it
(
'
escapes HTML as text
'
,
()
=>
{
it
(
'
escapes HTML as text
'
,
()
=>
{
...
@@ -135,12 +135,12 @@ describe('glDropdown', function describeDropdown() {
...
@@ -135,12 +135,12 @@ describe('glDropdown', function describeDropdown() {
});
});
it
(
'
should click the selected item on ENTER keypress
'
,
()
=>
{
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
;
const
randomIndex
=
Math
.
floor
(
Math
.
random
()
*
(
this
.
projectsData
.
length
-
1
))
+
0
;
navigateWithKeys
(
'
down
'
,
randomIndex
,
()
=>
{
navigateWithKeys
(
'
down
'
,
randomIndex
,
()
=>
{
spyOn
(
urlUtils
,
'
visitUrl
'
).
and
.
stub
();
spyOn
(
urlUtils
,
'
visitUrl
'
).
and
.
stub
();
navigateWithKeys
(
'
enter
'
,
null
,
()
=>
{
navigateWithKeys
(
'
enter
'
,
null
,
()
=>
{
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
not
.
toHaveClass
(
'
show
'
);
const
link
=
$
(
`
${
ITEM_SELECTOR
}
:eq(
${
randomIndex
}
) a`
,
this
.
$dropdownMenuElement
);
const
link
=
$
(
`
${
ITEM_SELECTOR
}
:eq(
${
randomIndex
}
) a`
,
this
.
$dropdownMenuElement
);
expect
(
link
).
toHaveClass
(
'
is-active
'
);
expect
(
link
).
toHaveClass
(
'
is-active
'
);
const
linkedLocation
=
link
.
attr
(
'
href
'
);
const
linkedLocation
=
link
.
attr
(
'
href
'
);
...
@@ -150,13 +150,13 @@ describe('glDropdown', function describeDropdown() {
...
@@ -150,13 +150,13 @@ describe('glDropdown', function describeDropdown() {
});
});
it
(
'
should close on ESC keypress
'
,
()
=>
{
it
(
'
should close on ESC keypress
'
,
()
=>
{
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
open
'
);
expect
(
this
.
dropdownContainerElement
).
toHaveClass
(
'
show
'
);
this
.
dropdownContainerElement
.
trigger
({
this
.
dropdownContainerElement
.
trigger
({
type
:
'
keyup
'
,
type
:
'
keyup
'
,
which
:
ARROW_KEYS
.
ESC
,
which
:
ARROW_KEYS
.
ESC
,
keyCode
:
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