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
72fc4059
Commit
72fc4059
authored
Feb 20, 2017
by
Phil Hughes
Committed by
Douglas Barbosa Alexandre
Mar 06, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed up failing JS tests
Added upcoming tests
parent
7e5e2144
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
7 deletions
+31
-7
app/assets/javascripts/boards/components/boards_selector.js
app/assets/javascripts/boards/components/boards_selector.js
+1
-1
app/assets/javascripts/boards/components/milestone_select.js
app/assets/javascripts/boards/components/milestone_select.js
+2
-2
spec/features/boards/board_with_milestone_spec.rb
spec/features/boards/board_with_milestone_spec.rb
+14
-0
spec/javascripts/boards/milestone_select_spec.js
spec/javascripts/boards/milestone_select_spec.js
+14
-4
No files found.
app/assets/javascripts/boards/components/boards_selector.js
View file @
72fc4059
...
...
@@ -96,7 +96,7 @@ require('./board_new_form');
},
updateMilestoneFilterDropdown
()
{
const
$milestoneDropdown
=
$
(
'
.dropdown-menu-milestone
'
);
const
hideElements
=
this
.
board
.
milestone
===
null
||
this
.
board
.
milestone
.
id
===
-
1
;
const
hideElements
=
this
.
board
.
milestone
===
undefined
||
this
.
board
.
milestone_
id
===
-
1
;
$milestoneDropdown
.
find
(
'
.dropdown-input, .dropdown-footer-list
'
)
.
toggle
(
hideElements
);
...
...
app/assets/javascripts/boards/components/milestone_select.js
View file @
72fc4059
...
...
@@ -26,8 +26,8 @@ module.exports = Vue.extend({
},
{
id
:
-
2
,
title
:
'
Upcoming
'
}
title
:
'
Upcoming
'
,
}
,
],
};
},
...
...
spec/features/boards/board_with_milestone_spec.rb
View file @
72fc4059
...
...
@@ -58,6 +58,20 @@ describe 'Multiple Issue Boards', :feature, :js do
expect
(
find
(
'.js-milestone-select'
)).
not_to
have_content
(
milestone
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
2
)
end
it
'sets board to any milestone'
do
update_board_milestone
(
'Any Milestone'
)
expect
(
find
(
'.js-milestone-select'
)).
not_to
have_content
(
milestone
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
2
)
end
it
'sets board to upcoming milestone'
do
update_board_milestone
(
'Upcoming'
)
expect
(
find
(
'.js-milestone-select'
)).
not_to
have_content
(
milestone
.
title
)
expect
(
all
(
'.board'
)[
1
]).
to
have_selector
(
'.card'
,
count:
0
)
end
end
def
create_board_with_milestone
...
...
spec/javascripts/boards/milestone_select_spec.js
View file @
72fc4059
...
...
@@ -37,8 +37,9 @@ describe('Milestone select component', () => {
it
(
'
sets default data
'
,
()
=>
{
expect
(
vm
.
loading
).
toBe
(
false
);
expect
(
vm
.
milestones
.
length
).
toBe
(
0
);
expect
(
vm
.
extraMilestones
.
length
).
toBe
(
1
);
expect
(
vm
.
extraMilestones
.
length
).
toBe
(
2
);
expect
(
vm
.
extraMilestones
[
0
].
title
).
toBe
(
'
Any Milestone
'
);
expect
(
vm
.
extraMilestones
[
1
].
title
).
toBe
(
'
Upcoming
'
);
});
});
...
...
@@ -58,9 +59,9 @@ describe('Milestone select component', () => {
it
(
'
renders the milestone list
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.fa-spinner
'
)).
toBeNull
();
expect
(
vm
.
$el
.
querySelectorAll
(
'
.board-milestone-list li
'
).
length
).
toBe
(
3
);
expect
(
vm
.
$el
.
querySelectorAll
(
'
.board-milestone-list li
'
).
length
).
toBe
(
4
);
expect
(
vm
.
$el
.
querySelectorAll
(
'
.board-milestone-list li
'
)[
2
].
textContent
,
vm
.
$el
.
querySelectorAll
(
'
.board-milestone-list li
'
)[
3
].
textContent
,
).
toContain
(
'
test
'
);
});
...
...
@@ -73,9 +74,18 @@ describe('Milestone select component', () => {
});
});
it
(
'
selects
fetched
milestone
'
,
()
=>
{
it
(
'
selects
upcoming
milestone
'
,
()
=>
{
vm
.
$el
.
querySelectorAll
(
'
.board-milestone-list a
'
)[
1
].
click
();
expect
(
selectMilestoneSpy
).
toHaveBeenCalledWith
({
id
:
-
2
,
title
:
'
Upcoming
'
,
});
});
it
(
'
selects fetched milestone
'
,
()
=>
{
vm
.
$el
.
querySelectorAll
(
'
.board-milestone-list a
'
)[
2
].
click
();
expect
(
selectMilestoneSpy
).
toHaveBeenCalledWith
({
id
:
1
,
title
:
'
test
'
,
...
...
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