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
Tatuya Kamada
gitlab-ce
Commits
3644162b
Commit
3644162b
authored
Aug 16, 2016
by
Douglas Barbosa Alexandre
Committed by
Phil Hughes
Aug 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix feature spec for issues board
parent
506ab9bd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
16 deletions
+32
-16
spec/features/boards/boards_spec.rb
spec/features/boards/boards_spec.rb
+32
-16
No files found.
spec/features/boards/boards_spec.rb
View file @
3644162b
...
@@ -5,15 +5,16 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -5,15 +5,16 @@ describe 'Issue Boards', feature: true, js: true do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:user2
)
{
create
(
:user
)
}
let
!
(
:user2
)
{
create
(
:user
)
}
before
do
before
do
project
.
create_board
!
project
.
create_board
create
(
:backlog_list
,
board:
project
.
board
)
project
.
board
.
lists
.
create
(
list_type: :backlog
)
create
(
:done_list
,
board:
project
.
board
)
project
.
board
.
lists
.
create
(
list_type: :done
)
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user2
,
:master
]
project
.
team
<<
[
user2
,
:master
]
login_as
(
user
)
login_as
(
user
)
end
end
...
@@ -81,7 +82,10 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -81,7 +82,10 @@ describe 'Issue Boards', feature: true, js: true do
wait_for_vue_resource
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
4
)
has_issues
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.card'
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
)
expect
(
find
(
'.board:nth-child(3)'
)).
to
have_selector
(
'.card'
)
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.card'
)
end
end
it
'shows lists'
do
it
'shows lists'
do
...
@@ -123,9 +127,10 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -123,9 +127,10 @@ describe 'Issue Boards', feature: true, js: true do
page
.
within
(
find
(
'.board:nth-child(2)'
))
do
page
.
within
(
find
(
'.board:nth-child(2)'
))
do
find
(
'.board-delete'
).
click
find
(
'.board-delete'
).
click
end
end
wait_for_vue_resource
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
3
)
expect
(
find
(
".js-board-list-
#{
planning
.
id
}
"
,
visible:
false
)).
not_to
have_css
(
'.is-active'
)
expect
(
find
(
".js-board-list-
#{
planning
.
id
}
"
,
visible:
false
)).
not_to
have_css
(
'.is-active'
)
end
end
...
@@ -273,6 +278,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -273,6 +278,8 @@ describe 'Issue Boards', feature: true, js: true do
click_link
testing
.
title
click_link
testing
.
title
end
end
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
end
end
...
@@ -283,6 +290,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -283,6 +290,8 @@ describe 'Issue Boards', feature: true, js: true do
click_link
backlog
.
title
click_link
backlog
.
title
end
end
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
end
end
...
@@ -293,6 +302,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -293,6 +302,8 @@ describe 'Issue Boards', feature: true, js: true do
click_link
done
.
title
click_link
done
.
title
end
end
wait_for_vue_resource
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
expect
(
page
).
to
have_selector
(
'.board'
,
count:
5
)
end
end
...
@@ -308,6 +319,8 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -308,6 +319,8 @@ describe 'Issue Boards', feature: true, js: true do
click_link
testing
.
title
click_link
testing
.
title
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
(
'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
)
...
@@ -537,18 +550,21 @@ describe 'Issue Boards', feature: true, js: true do
...
@@ -537,18 +550,21 @@ describe 'Issue Boards', feature: true, js: true do
end
end
end
end
def
has_issues
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.card'
)
expect
(
find
(
'.board:nth-child(2)'
)).
to
have_selector
(
'.card'
)
expect
(
find
(
'.board:nth-child(3)'
)).
to
have_selector
(
'.card'
)
expect
(
find
(
'.board:nth-child(4)'
)).
to
have_selector
(
'.card'
)
end
def
drag_to
(
list_from_index:
0
,
card_index:
0
,
to_index:
0
,
list_to_index:
0
,
selector:
'.board-list'
)
def
drag_to
(
list_from_index:
0
,
card_index:
0
,
to_index:
0
,
list_to_index:
0
,
selector:
'.board-list'
)
evaluate_script
(
"simulateDrag({scrollable: document.getElementById('board-app'), from: {el: $('
#{
selector
}
').eq(
#{
list_from_index
}
).get(0), index:
#{
card_index
}
}, to: {el: $('.board-list').eq(
#{
list_to_index
}
).get(0), index:
#{
to_index
}
}});"
)
evaluate_script
(
"simulateDrag({scrollable: document.getElementById('board-app'), from: {el: $('
#{
selector
}
').eq(
#{
list_from_index
}
).get(0), index:
#{
card_index
}
}, to: {el: $('.board-list').eq(
#{
list_to_index
}
).get(0), index:
#{
to_index
}
}});"
)
Timeout
.
timeout
(
Capybara
.
default_max_wait_time
)
do
loop
until
page
.
evaluate_script
(
'window.SIMULATE_DRAG_ACTIVE'
).
zero?
end
wait_for_vue_resource
end
end
def
wait_for_vue_resource
def
wait_for_vue_resource
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'
)
expect
(
find
(
'.boards-list'
)).
not_to
have_selector
(
'.fa-spinner'
)
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