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
7c53891e
Commit
7c53891e
authored
Dec 08, 2021
by
Florie Guibert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add rspec tests for new filtered search tokens on boards
Review feedback
parent
fe4548cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
22 deletions
+20
-22
spec/features/boards/board_filters_spec.rb
spec/features/boards/board_filters_spec.rb
+20
-22
No files found.
spec/features/boards/board_filters_spec.rb
View file @
7c53891e
...
...
@@ -11,11 +11,11 @@ RSpec.describe 'Issue board filters', :js do
let_it_be
(
:milestone_2
)
{
create
(
:milestone
,
project:
project
)
}
let_it_be
(
:release
)
{
create
(
:release
,
tag:
'v1.0'
,
project:
project
,
milestones:
[
milestone_1
])
}
let_it_be
(
:release_2
)
{
create
(
:release
,
tag:
'v2.0'
,
project:
project
,
milestones:
[
milestone_2
])
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
,
milestone:
milestone_1
,
author:
user
)
}
let_it_be
(
:issue
_1
)
{
create
(
:issue
,
project:
project
,
milestone:
milestone_1
,
author:
user
)
}
let_it_be
(
:issue_2
)
{
create
(
:labeled_issue
,
project:
project
,
milestone:
milestone_2
,
assignees:
[
user
],
labels:
[
project_label
])
}
let_it_be
(
:award_emoji1
)
{
create
(
:award_emoji
,
name:
'thumbsup'
,
user:
user
,
awardable:
issue
)
}
let_it_be
(
:award_emoji1
)
{
create
(
:award_emoji
,
name:
'thumbsup'
,
user:
user
,
awardable:
issue
_1
)
}
let
(
:filtered_search
)
{
find
(
'[data-testid="issue-board-filtered-search"]'
)
}
let
(
:filtered_search
)
{
find
(
'[data-testid="issue
_1
-board-filtered-search"]'
)
}
let
(
:filter_input
)
{
find
(
'.gl-filtered-search-term-input'
)}
let
(
:filter_dropdown
)
{
find
(
'.gl-filtered-search-suggestion-list'
)
}
let
(
:filter_first_suggestion
)
{
find
(
'.gl-filtered-search-suggestion-list'
).
first
(
'.gl-filtered-search-suggestion'
)
}
...
...
@@ -30,12 +30,8 @@ RSpec.describe 'Issue board filters', :js do
visit_project_board
end
describe
'filters by assignee'
do
before
do
set_filter
(
'assignee'
)
end
it
'loads all the users when opened and submit one as assignee filter'
,
:aggregate_failures
do
shared_examples
'loads all the users when opened'
do
it
'and submit one as filter'
,
:aggregate_failures
do
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.board-card'
,
count:
2
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
3
)
...
...
@@ -44,25 +40,27 @@ RSpec.describe 'Issue board filters', :js do
filter_submit
.
click
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.board-card'
,
count:
1
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
_2
.
title
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
.
title
)
end
end
describe
'filters by a
uthor
'
do
describe
'filters by a
ssignee
'
do
before
do
set_filter
(
'a
uthor
'
)
set_filter
(
'a
ssignee
'
)
end
it
'loads all the users when opened and submit one as author filter'
,
:aggregate_failures
do
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.board-card'
,
count:
2
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
3
)
it
_behaves_like
'loads all the users when opened'
do
let
(
:issue
)
{
issue_2
}
end
end
click_on
user
.
username
filter_submit
.
click
describe
'filters by author'
do
before
do
set_filter
(
'author'
)
end
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.board-card'
,
count:
1
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
.
title
)
it_behaves_like
'loads all the users when opened'
do
let
(
:issue
)
{
issue_1
}
end
end
...
...
@@ -98,7 +96,7 @@ RSpec.describe 'Issue board filters', :js do
filter_submit
.
click
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.board-card'
,
count:
1
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
.
title
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
_1
.
title
)
end
end
...
...
@@ -139,7 +137,7 @@ RSpec.describe 'Issue board filters', :js do
filter_submit
.
click
expect
(
find
(
'.board:nth-child(1)'
)).
to
have_selector
(
'.board-card'
,
count:
1
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
.
title
)
expect
(
find
(
'.board-card'
)).
to
have_content
(
issue
_1
.
title
)
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