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
65a9fda2
Commit
65a9fda2
authored
Sep 17, 2021
by
Coung Ngo
Committed by
Terri Chu
Sep 17, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve issues feature specs
parent
97e1bbe5
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
116 deletions
+61
-116
ee/spec/features/groups/issues_spec.rb
ee/spec/features/groups/issues_spec.rb
+6
-8
ee/spec/features/issues/filtered_search/dropdown_epic_spec.rb
...pec/features/issues/filtered_search/dropdown_epic_spec.rb
+0
-54
ee/spec/features/issues/filtered_search/dropdown_weight_spec.rb
...c/features/issues/filtered_search/dropdown_weight_spec.rb
+0
-30
ee/spec/features/issues/filtered_search/filter_issues_epic_spec.rb
...eatures/issues/filtered_search/filter_issues_epic_spec.rb
+41
-12
ee/spec/features/issues/filtered_search/filter_issues_weight_spec.rb
...tures/issues/filtered_search/filter_issues_weight_spec.rb
+9
-1
spec/features/groups/issues_spec.rb
spec/features/groups/issues_spec.rb
+2
-2
spec/features/issues/filtered_search/filter_issues_spec.rb
spec/features/issues/filtered_search/filter_issues_spec.rb
+3
-6
spec/features/issues/filtered_search/visual_tokens_spec.rb
spec/features/issues/filtered_search/visual_tokens_spec.rb
+0
-3
No files found.
ee/spec/features/groups/issues_spec.rb
View file @
65a9fda2
...
...
@@ -17,7 +17,7 @@ RSpec.describe 'Group issues page' do
end
it
'shows sidebar when clicked on "Edit issues"'
do
find
(
'.js-bulk-update-toggle'
).
click
click_button
'Edit issues'
page
.
within
(
'.js-right-sidebar'
)
do
expect
(
page
).
to
have_selector
(
'.issuable-sidebar'
,
visible:
true
)
...
...
@@ -25,15 +25,13 @@ RSpec.describe 'Group issues page' do
end
it
'shows group milestones within "Milestone" dropdown'
do
find
(
'.js-bulk-update-toggle'
).
click
click_button
'Edit issues'
page
.
within
(
'.js-right-sidebar'
)
do
find
(
'button.js-milestone-select'
).
click
wait_for_requests
click_button
'Select milestone'
wait_for_requests
page
.
within
(
'.dropdown-menu-milestone .dropdown-content'
)
do
expect
(
page
).
to
have_content
(
milestone
.
title
)
end
page
.
within
(
'.dropdown-menu-milestone .dropdown-content'
)
do
expect
(
page
).
to
have_content
(
milestone
.
title
)
end
end
end
...
...
ee/spec/features/issues/filtered_search/dropdown_epic_spec.rb
deleted
100644 → 0
View file @
97e1bbe5
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Dropdown epic'
,
:js
do
include
FilteredSearchHelpers
let_it_be
(
:group
)
{
create
(
:group
)
}
let_it_be
(
:project
)
{
create
(
:project
,
group:
group
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:epic2
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_epic
)
{
'#js-dropdown-epic'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_epic
}
.filter-dropdown"
)
}
before
do
stub_licensed_features
(
epics:
true
)
group
.
add_maintainer
(
user
)
sign_in
(
user
)
visit
issues_group_path
(
group
)
end
describe
'behavior'
do
it
'loads all the epics when opened'
do
input_filtered_search
(
'epic:='
,
submit:
false
,
extra_space:
false
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
2
)
end
it
'selects epic and correct title is loaded'
do
input_filtered_search
(
'epic:='
,
submit:
false
,
extra_space:
false
)
wait_for_requests
find
(
'li'
,
text:
epic
.
title
).
click
expect
(
find
(
'.filtered-search-token .value'
).
text
).
to
eq
(
"
\"
#{
epic
.
title
}
\"
::&
#{
epic
.
id
}
"
)
end
it
'filters issues by epic'
do
input_filtered_search
(
'epic:='
,
submit:
false
,
extra_space:
false
)
wait_for_requests
find
(
'li'
,
text:
epic2
.
title
).
click
expect
(
find
(
'.issue-title-text'
).
text
).
to
eq
(
"
#{
issue
.
title
}
"
)
end
end
end
ee/spec/features/issues/filtered_search/dropdown_weight_spec.rb
deleted
100644 → 0
View file @
97e1bbe5
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
'Dropdown weight'
,
:js
do
include
FilteredSearchHelpers
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:js_dropdown_weight
)
{
'#js-dropdown-weight'
}
let
(
:filter_dropdown
)
{
find
(
"
#{
js_dropdown_weight
}
.filter-dropdown"
)
}
before
do
project
.
add_maintainer
(
user
)
sign_in
(
user
)
visit
project_issues_path
(
project
)
end
describe
'behavior'
do
it
'loads all the weights when opened'
do
input_filtered_search
(
'weight:='
,
submit:
false
,
extra_space:
false
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
21
)
end
end
end
ee/spec/features/issues/filtered_search/filter_issues_epic_spec.rb
View file @
65a9fda2
...
...
@@ -11,33 +11,62 @@ RSpec.describe 'Filter issues by epic', :js do
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:issue3
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:issue4
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:epic1
)
{
create
(
:epic
)
}
let_it_be
(
:epic2
)
{
create
(
:epic
)
}
let_it_be
(
:epic1
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:epic2
)
{
create
(
:epic
,
group:
group
)
}
let_it_be
(
:epic_issue1
)
{
create
(
:epic_issue
,
issue:
issue1
,
epic:
epic1
)
}
let_it_be
(
:epic_issue2
)
{
create
(
:epic_issue
,
issue:
issue2
,
epic:
epic2
)
}
let_it_be
(
:epic_issue3
)
{
create
(
:epic_issue
,
issue:
issue3
,
epic:
epic2
)
}
let
(
:
js_dropdown
)
{
'#js-dropdown-epic'
}
let
(
:
filter_dropdown
)
{
find
(
"#js-dropdown-epic .filter-dropdown"
)
}
before
do
stub_licensed_features
(
epics:
true
)
stub_feature_flags
(
vue_issuables_list:
false
)
project
.
add_develop
er
(
user
)
group
.
add_maintain
er
(
user
)
sign_in
(
user
)
visit
project_issues_path
(
project
)
end
it
'filter issues by epic'
do
input_filtered_search
(
"epic:=&
#{
epic1
.
id
}
"
)
shared_examples
'filter issues by epic'
do
it
'filters issues by epic'
do
input_filtered_search
(
"epic:=&
#{
epic1
.
id
}
"
)
expect_issues_list_count
(
1
)
expect_issues_list_count
(
1
)
end
it
'filters issues by negated epic'
do
input_filtered_search
(
"epic:!=&
#{
epic1
.
id
}
"
)
expect_issues_list_count
(
2
)
end
it
'shows epics in the filtered search dropdown'
do
input_filtered_search
(
'epic:='
,
submit:
false
,
extra_space:
false
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
2
)
end
it
'shows correct filtered search epic token value'
do
input_filtered_search
(
'epic:='
,
submit:
false
,
extra_space:
false
)
click_on
epic1
.
title
expect
(
find
(
'.filtered-search-token .value'
).
text
).
to
eq
(
"
\"
#{
epic1
.
title
}
\"
::&
#{
epic1
.
id
}
"
)
end
end
context
'when group issues list page'
do
before
do
visit
issues_group_path
(
group
)
end
it_behaves_like
'filter issues by epic'
end
it
'filter issues not in the epic'
do
input_filtered_search
(
"epic:!=&
#{
epic1
.
id
}
"
)
context
'when project issues list page'
do
before
do
visit
project_issues_path
(
project
)
end
expect_issues_list_count
(
3
)
it_behaves_like
'filter issues by epic'
end
end
ee/spec/features/issues/filtered_search/filter_issues_weight_spec.rb
View file @
65a9fda2
...
...
@@ -12,7 +12,7 @@ RSpec.describe 'Filter issues weight', :js do
let_it_be
(
:issue1
)
{
create
(
:issue
,
project:
project
,
weight:
1
)
}
let_it_be
(
:issue2
)
{
create
(
:issue
,
project:
project
,
weight:
2
,
title:
'Bug report 1'
,
milestone:
milestone
,
author:
user
,
assignees:
[
user
],
labels:
[
label
])
}
let
(
:
js_dropdown_weight
)
{
'#js-dropdown-weight'
}
let
(
:
filter_dropdown
)
{
find
(
"#js-dropdown-weight .filter-dropdown"
)
}
shared_examples
'filters by negated weight'
do
it
'excludes issues with specified weight'
do
...
...
@@ -38,6 +38,14 @@ RSpec.describe 'Filter issues weight', :js do
visit
project_issues_path
(
project
)
end
describe
'behavior'
do
it
'loads all the weights when opened'
do
input_filtered_search
(
'weight:='
,
submit:
false
,
extra_space:
false
)
expect_filtered_search_dropdown_results
(
filter_dropdown
,
21
)
end
end
describe
'only weight'
do
it
'filter issues by searched weight'
do
input_filtered_search
(
'weight:=1'
)
...
...
spec/features/groups/issues_spec.rb
View file @
65a9fda2
...
...
@@ -33,7 +33,7 @@ RSpec.describe 'Group issues page' do
# However,`:js` option forces Capybara to use Selenium that doesn't support`:has`
context
"it has an RSS button with current_user's feed token"
do
it
"shows the RSS button with current_user's feed token"
do
expect
(
find
(
'[data-testid="rss-feed-link"]'
)[
'href'
]).
to
have_content
(
user
.
feed_token
)
expect
(
page
).
to
have_link
'Subscribe to RSS feed'
,
href:
/feed_token=
#{
user
.
feed_token
}
/
end
end
end
...
...
@@ -46,7 +46,7 @@ RSpec.describe 'Group issues page' do
# Note: please see the above
context
"it has an RSS button without a feed token"
do
it
"shows the RSS button without a feed token"
do
expect
(
find
(
'[data-testid="rss-feed-link"]'
)[
'href'
]).
not_to
have_content
(
'feed_token'
)
expect
(
page
).
not_to
have_link
'Subscribe to RSS feed'
,
href:
/feed_token/
end
end
end
...
...
spec/features/issues/filtered_search/filter_issues_spec.rb
View file @
65a9fda2
...
...
@@ -565,21 +565,18 @@ RSpec.describe 'Filter issues', :js do
end
it
'maintains filter'
do
# Closed
find
(
'.issues-state-filters [data-state="closed"]'
).
click
click_link
'Closed'
wait_for_requests
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
1
)
expect
(
page
).
to
have_link
(
closed_issue
.
title
)
# Opened
find
(
'.issues-state-filters [data-state="opened"]'
).
click
click_link
'Open'
wait_for_requests
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
4
)
# All
find
(
'.issues-state-filters [data-state="all"]'
).
click
click_link
'All'
wait_for_requests
expect
(
page
).
to
have_selector
(
'.issues-list .issue'
,
count:
5
)
...
...
spec/features/issues/filtered_search/visual_tokens_spec.rb
View file @
65a9fda2
...
...
@@ -16,9 +16,6 @@ RSpec.describe 'Visual tokens', :js do
let
(
:filtered_search
)
{
find
(
'.filtered-search'
)
}
let
(
:filter_author_dropdown
)
{
find
(
"#js-dropdown-author .filter-dropdown"
)
}
let
(
:filter_assignee_dropdown
)
{
find
(
"#js-dropdown-assignee .filter-dropdown"
)
}
let
(
:filter_milestone_dropdown
)
{
find
(
"#js-dropdown-milestone .filter-dropdown"
)
}
let
(
:filter_label_dropdown
)
{
find
(
"#js-dropdown-label .filter-dropdown"
)
}
def
is_input_focused
page
.
evaluate_script
(
"document.activeElement.classList.contains('filtered-search')"
)
...
...
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