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
19b8437b
Commit
19b8437b
authored
Aug 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests updated
parent
7a68262d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
25 deletions
+14
-25
app/assets/javascripts/boards/models/list.js.es6
app/assets/javascripts/boards/models/list.js.es6
+1
-1
app/assets/javascripts/boards/services/board_service.js.es6
app/assets/javascripts/boards/services/board_service.js.es6
+6
-6
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+7
-18
No files found.
app/assets/javascripts/boards/models/list.js.es6
View file @
19b8437b
...
...
@@ -50,7 +50,7 @@ class List {
}
update () {
gl.boardService.updateList(this);
gl.boardService.updateList(this
.id, this.position
);
}
nextPage () {
...
...
app/assets/javascripts/boards/services/board_service.js.es6
View file @
19b8437b
...
...
@@ -2,14 +2,14 @@ class BoardService {
constructor (root) {
Vue.http.options.root = root;
this.lists = Vue.resource(`${root}/lists{/id}
.json
`, {}, {
this.lists = Vue.resource(`${root}/lists{/id}`, {}, {
generate: {
method: 'POST',
url: `${root}/lists/generate.json`
}
});
this.issue = Vue.resource(`${root}/issues{/id}
.json
`, {});
this.issues = Vue.resource(`${root}/lists{/id}/issues
.json
`, {});
this.issue = Vue.resource(`${root}/issues{/id}`, {});
this.issues = Vue.resource(`${root}/lists{/id}/issues`, {});
}
setCSRF () {
...
...
@@ -37,12 +37,12 @@ class BoardService {
});
}
updateList (
list
) {
updateList (
id, position
) {
this.setCSRF();
return this.lists.update({ id
: list.id
}, {
return this.lists.update({ id }, {
list: {
position
: list.position
position
}
});
}
...
...
spec/features/boards/boards_spec.rb
View file @
19b8437b
...
...
@@ -17,15 +17,15 @@ describe 'Issue Boards', feature: true, js: true do
context
'no lists'
do
before
do
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
end
it
'shows blank state'
do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
page
).
to
have_content
(
'Welcome to your Issue Board!'
)
end
it
'hides the blank state when clicking nevermind button'
do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
page
.
within
(
find
(
'.board-blank-state'
))
do
click_button
(
"Nevermind, I'll use my own"
)
end
...
...
@@ -33,8 +33,6 @@ describe 'Issue Boards', feature: true, js: true do
end
it
'creates default lists'
do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
lists
=
[
'Backlog'
,
'Development'
,
'Testing'
,
'Production'
,
'Ready'
,
'Done'
]
page
.
within
(
find
(
'.board-blank-state'
))
do
...
...
@@ -78,10 +76,12 @@ describe 'Issue Boards', feature: true, js: true do
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
has_issues
end
it
'shows lists'
do
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
end
...
...
@@ -169,14 +169,11 @@ describe 'Issue Boards', feature: true, js: true do
find
(
'.board-search-clear-btn'
).
click
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
end
end
it
'moves issue from backlog into list'
do
has_issues
drag_to
(
list_to_index:
1
)
page
.
within
(
find
(
'.board'
,
match: :first
))
do
...
...
@@ -197,7 +194,6 @@ describe 'Issue Boards', feature: true, js: true do
end
it
'moves issue to done'
do
has_issues
drag_to
(
list_from_index:
0
,
list_to_index:
3
)
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.card'
,
count:
2
)
...
...
@@ -206,7 +202,6 @@ describe 'Issue Boards', feature: true, js: true do
end
it
'removes all of the same issue to done'
do
has_issues
drag_to
(
list_from_index:
1
,
list_to_index:
3
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
1
)
...
...
@@ -218,16 +213,13 @@ describe 'Issue Boards', feature: true, js: true do
context
'lists'
do
it
'changes position of list'
do
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
has_issues
drag_to
(
list_from_index:
1
,
list_to_index:
2
,
selector:
'.js-board-handle'
)
drag_to
(
list_from_index:
1
,
list_to_index:
2
,
selector:
'.board-header'
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_content
(
development
.
title
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_content
(
planning
.
title
)
end
it
'issue moves between lists'
do
has_issues
drag_to
(
list_from_index:
1
,
card_index:
1
,
list_to_index:
2
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
1
)
...
...
@@ -237,7 +229,6 @@ describe 'Issue Boards', feature: true, js: true do
end
it
'issue moves between lists'
do
has_issues
drag_to
(
list_from_index:
2
,
list_to_index:
1
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
3
)
...
...
@@ -247,7 +238,6 @@ describe 'Issue Boards', feature: true, js: true do
end
it
'issue moves from done'
do
has_issues
drag_to
(
list_from_index:
3
,
list_to_index:
1
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
,
count:
3
)
...
...
@@ -441,8 +431,6 @@ describe 'Issue Boards', feature: true, js: true do
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
wait_for_vue_resource
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'40'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
end
...
...
@@ -565,5 +553,6 @@ describe 'Issue Boards', feature: true, js: true do
Timeout
.
timeout
(
Capybara
.
default_max_wait_time
)
do
loop
until
page
.
evaluate_script
(
'Vue.activeResources'
).
zero?
end
expect
(
find
(
'.boards-list'
)).
not_to
have_selector
(
'.fa-spinner'
)
end
end
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