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
82481a6a
Commit
82481a6a
authored
Aug 16, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added vue resource interceptor
parent
01335d7c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
+41
-2
app/assets/javascripts/boards/boards_bundle.js.es6
app/assets/javascripts/boards/boards_bundle.js.es6
+1
-0
app/assets/javascripts/boards/vue_resource_interceptor.js.es6
...assets/javascripts/boards/vue_resource_interceptor.js.es6
+9
-0
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+31
-2
No files found.
app/assets/javascripts/boards/boards_bundle.js.es6
View file @
82481a6a
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
//= require_tree ./mixins
//= require_tree ./mixins
//= require ./components/board
//= require ./components/board
//= require ./components/new_list_dropdown
//= require ./components/new_list_dropdown
//= require ./vue_resource_interceptor
$(() => {
$(() => {
const $boardApp = document.getElementById('board-app'),
const $boardApp = document.getElementById('board-app'),
...
...
app/assets/javascripts/boards/vue_resource_interceptor.js.es6
0 → 100644
View file @
82481a6a
Vue.activeResources = 0;
Vue.http.interceptors.push((request, next) => {
Vue.activeResources++;
next((response) => {
Vue.activeResources--;
});
});
spec/features/boards/boards_spec.rb
View file @
82481a6a
...
@@ -72,10 +72,11 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -72,10 +72,11 @@ describe 'Issue Boards', feature: true, js: true do
before
do
before
do
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
sleep
1
wait_for_vue_resource
end
end
it
'shows lists'
do
it
'shows lists'
do
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
end
end
...
@@ -122,7 +123,7 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -122,7 +123,7 @@ describe 'Issue Boards', feature: true, js: true do
end
end
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
visit
namespace_project_board_path
(
project
.
namespace
,
project
)
sleep
1
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'20'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'20'
)
...
@@ -159,6 +160,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -159,6 +160,8 @@ describe 'Issue Boards', feature: true, js: true do
find
(
'.board-search-clear-btn'
).
click
find
(
'.board-search-clear-btn'
).
click
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
6
)
end
end
end
end
...
@@ -315,6 +318,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -315,6 +318,8 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
find
(
'.js-author-search'
)).
to
have_content
(
user2
.
name
)
expect
(
find
(
'.js-author-search'
)).
to
have_content
(
user2
.
name
)
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
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
)
...
@@ -337,6 +342,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -337,6 +342,8 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
find
(
'.js-assignee-search'
)).
to
have_content
(
user
.
name
)
expect
(
find
(
'.js-assignee-search'
)).
to
have_content
(
user
.
name
)
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
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
)
...
@@ -359,6 +366,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -359,6 +366,8 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
find
(
'.js-milestone-select'
)).
to
have_content
(
milestone
.
title
)
expect
(
find
(
'.js-milestone-select'
)).
to
have_content
(
milestone
.
title
)
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'0'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'0'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
0
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
0
)
...
@@ -380,6 +389,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -380,6 +389,8 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
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
)
...
@@ -405,12 +416,16 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -405,12 +416,16 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'20'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'20'
)
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
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
)
end
end
...
@@ -427,6 +442,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -427,6 +442,8 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
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
)
...
@@ -448,6 +465,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -448,6 +465,8 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
do
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'5'
)
expect
(
page
.
find
(
'.board-header'
)).
to
have_content
(
'5'
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
5
)
...
@@ -469,6 +488,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -469,6 +488,8 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
wait_for_vue_resource
page
.
within
(
first
(
'.board'
))
do
page
.
within
(
first
(
'.board'
))
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
)
...
@@ -499,6 +520,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -499,6 +520,8 @@ describe 'Issue Boards', feature: true, js: true do
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
expect
(
page
).
to
have_selector
(
'.card'
,
count:
1
)
end
end
wait_for_vue_resource
page
.
within
(
'.labels-filter'
)
do
page
.
within
(
'.labels-filter'
)
do
expect
(
find
(
'.dropdown-toggle-text'
)).
to
have_content
(
bug
.
title
)
expect
(
find
(
'.dropdown-toggle-text'
)).
to
have_content
(
bug
.
title
)
end
end
...
@@ -513,4 +536,10 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -513,4 +536,10 @@ describe 'Issue Boards', feature: true, js: true do
loop
until
page
.
evaluate_script
(
'window.SIMULATE_DRAG_ACTIVE'
).
zero?
loop
until
page
.
evaluate_script
(
'window.SIMULATE_DRAG_ACTIVE'
).
zero?
end
end
end
end
def
wait_for_vue_resource
Timeout
.
timeout
(
Capybara
.
default_max_wait_time
)
do
loop
until
page
.
evaluate_script
(
'Vue.activeResources'
).
zero?
end
end
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