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
893f5e22
Commit
893f5e22
authored
Aug 18, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempted improvement to stop boards spec failing
parent
1f144951
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
app/assets/javascripts/boards/vue_resource_interceptor.js.es6
...assets/javascripts/boards/vue_resource_interceptor.js.es6
+5
-3
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+25
-1
No files found.
app/assets/javascripts/boards/vue_resource_interceptor.js.es6
View file @
893f5e22
Vue.http.interceptors.push((request, next) => {
Vue.http.interceptors.push((request, next) => {
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
Vue.activeResources = Vue.activeResources ? Vue.activeResources + 1 : 1;
setTimeout(() => {
Vue.nextTick(() => {
Vue.activeResources--;
setTimeout(() => {
}, 500);
Vue.activeResources--;
}, 500);
});
next();
next();
});
});
spec/features/boards/boards_spec.rb
View file @
893f5e22
...
@@ -147,6 +147,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -147,6 +147,7 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
20
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
20
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
evaluate_script
(
"document.querySelectorAll('.board .board-list')[0].scrollTop = document.querySelectorAll('.board .board-list')[0].scrollHeight"
)
wait_for_vue_resource
(
spinner:
false
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'40'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'40'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
40
)
...
@@ -165,6 +166,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -165,6 +166,8 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
find
(
'.form-control'
).
set
issue1
.
title
find
(
'.form-control'
).
set
issue1
.
title
wait_for_vue_resource
(
spinner:
false
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
end
end
...
@@ -176,7 +179,11 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -176,7 +179,11 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
find
(
'.board-search-clear-btn'
).
click
find
(
'.board-search-clear-btn'
).
click
end
wait_for_vue_resource
page
.
within
(
find
(
'.board'
,
match: :first
))
do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
end
end
end
end
...
@@ -189,6 +196,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -189,6 +196,8 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
end
end
wait_for_vue_resource
page
.
within
(
find
(
'.board:nth-child(2)'
))
do
page
.
within
(
find
(
'.board:nth-child(2)'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'3'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'3'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
3
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
3
)
...
@@ -263,6 +272,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -263,6 +272,7 @@ describe 'Issue Boards', feature: true, js: true do
context
'new list'
do
context
'new list'
do
it
'shows all labels in new list dropdown'
do
it
'shows all labels in new list dropdown'
do
click_button
'Create new list'
click_button
'Create new list'
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
expect
(
page
).
to
have_content
(
planning
.
title
)
expect
(
page
).
to
have_content
(
planning
.
title
)
...
@@ -273,6 +283,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -273,6 +283,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'creates new list for label'
do
it
'creates new list for label'
do
click_button
'Create new list'
click_button
'Create new list'
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
testing
.
title
click_link
testing
.
title
...
@@ -285,6 +296,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -285,6 +296,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'creates new list for Backlog label'
do
it
'creates new list for Backlog label'
do
click_button
'Create new list'
click_button
'Create new list'
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
backlog
.
title
click_link
backlog
.
title
...
@@ -297,6 +309,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -297,6 +309,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'creates new list for Done label'
do
it
'creates new list for Done label'
do
click_button
'Create new list'
click_button
'Create new list'
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
done
.
title
click_link
done
.
title
...
@@ -314,6 +327,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -314,6 +327,7 @@ describe 'Issue Boards', feature: true, js: true do
end
end
click_button
'Create new list'
click_button
'Create new list'
wait_for_ajax
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
page
.
within
(
'.dropdown-menu-issues-board-new'
)
do
click_link
testing
.
title
click_link
testing
.
title
...
@@ -333,6 +347,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -333,6 +347,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by author'
do
it
'filters by author'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Author'
)
click_button
(
'Author'
)
wait_for_ajax
page
.
within
'.dropdown-menu-author'
do
page
.
within
'.dropdown-menu-author'
do
click_link
(
user2
.
name
)
click_link
(
user2
.
name
)
...
@@ -358,6 +373,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -358,6 +373,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by assignee'
do
it
'filters by assignee'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Assignee'
)
click_button
(
'Assignee'
)
wait_for_ajax
page
.
within
'.dropdown-menu-assignee'
do
page
.
within
'.dropdown-menu-assignee'
do
click_link
(
user
.
name
)
click_link
(
user
.
name
)
...
@@ -383,6 +399,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -383,6 +399,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by milestone'
do
it
'filters by milestone'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Milestone'
)
click_button
(
'Milestone'
)
wait_for_ajax
page
.
within
'.milestone-filter'
do
page
.
within
'.milestone-filter'
do
click_link
(
milestone
.
title
)
click_link
(
milestone
.
title
)
...
@@ -408,6 +425,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -408,6 +425,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by label'
do
it
'filters by label'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Label'
)
click_button
(
'Label'
)
wait_for_ajax
page
.
within
'.dropdown-menu-labels'
do
page
.
within
'.dropdown-menu-labels'
do
click_link
(
testing
.
title
)
click_link
(
testing
.
title
)
...
@@ -436,6 +454,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -436,6 +454,7 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Label'
)
click_button
(
'Label'
)
wait_for_ajax
page
.
within
'.dropdown-menu-labels'
do
page
.
within
'.dropdown-menu-labels'
do
click_link
(
testing
.
title
)
click_link
(
testing
.
title
)
...
@@ -460,8 +479,9 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -460,8 +479,9 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by multiple labels'
do
it
'filters by multiple labels'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Label'
)
click_button
(
'Label'
)
wait_for_ajax
page
.
within
'.dropdown-menu-labels'
do
page
.
within
(
find
(
'.dropdown-menu-labels'
))
do
click_link
(
testing
.
title
)
click_link
(
testing
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
(
spinner:
false
)
click_link
(
bug
.
title
)
click_link
(
bug
.
title
)
...
@@ -486,6 +506,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -486,6 +506,7 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by no label'
do
it
'filters by no label'
do
page
.
within
'.issues-filters'
do
page
.
within
'.issues-filters'
do
click_button
(
'Label'
)
click_button
(
'Label'
)
wait_for_ajax
page
.
within
'.dropdown-menu-labels'
do
page
.
within
'.dropdown-menu-labels'
do
click_link
(
"No Label"
)
click_link
(
"No Label"
)
...
@@ -510,10 +531,13 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -510,10 +531,13 @@ describe 'Issue Boards', feature: true, js: true do
it
'filters by clicking label button on issue'
do
it
'filters by clicking label button on issue'
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
expect
(
find
(
'.card'
,
match: :first
)).
to
have_content
(
bug
.
title
)
click_button
(
bug
.
title
)
click_button
(
bug
.
title
)
wait_for_vue_resource
(
spinner:
false
)
wait_for_vue_resource
(
spinner:
false
)
end
end
wait_for_vue_resource
page
.
within
(
find
(
'.board'
,
match: :first
))
do
page
.
within
(
find
(
'.board'
,
match: :first
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'1'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'1'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
...
...
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