summaryrefslogtreecommitdiff
path: root/spec/features/issuables
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-20 13:37:47 +0000
commitaee0a117a889461ce8ced6fcf73207fe017f1d99 (patch)
tree891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/features/issuables
parent8d46af3258650d305f53b819eabf7ab18d22f59e (diff)
downloadgitlab-ce-aee0a117a889461ce8ced6fcf73207fe017f1d99.tar.gz
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/features/issuables')
-rw-r--r--spec/features/issuables/shortcuts_issuable_spec.rb86
-rw-r--r--spec/features/issuables/sorting_list_spec.rb12
2 files changed, 90 insertions, 8 deletions
diff --git a/spec/features/issuables/shortcuts_issuable_spec.rb b/spec/features/issuables/shortcuts_issuable_spec.rb
index 78cd8d0bef3..7e8f39c47a7 100644
--- a/spec/features/issuables/shortcuts_issuable_spec.rb
+++ b/spec/features/issuables/shortcuts_issuable_spec.rb
@@ -44,4 +44,90 @@ RSpec.describe 'Blob shortcuts', :js do
include_examples 'quotes the selected text'
end
end
+
+ shared_examples "opens assignee dropdown for editing" do
+ it "opens assignee dropdown for editing" do
+ find('body').native.send_key('a')
+
+ expect(find('.block.assignee')).to have_selector('.js-sidebar-assignee-data')
+ end
+ end
+
+ describe 'pressing "a"' do
+ describe 'On an Issue' do
+ before do
+ stub_feature_flags(issue_assignees_widget: false)
+ visit project_issue_path(project, issue)
+ wait_for_requests
+ end
+
+ include_examples 'opens assignee dropdown for editing'
+ end
+
+ describe 'On a Merge Request' do
+ before do
+ stub_feature_flags(issue_assignees_widget: false)
+ visit project_merge_request_path(project, merge_request)
+ wait_for_requests
+ end
+
+ include_examples 'opens assignee dropdown for editing'
+ end
+ end
+
+ shared_examples "opens milestones dropdown for editing" do
+ it "opens milestones dropdown for editing" do
+ find('body').native.send_key('m')
+
+ expect(find('[data-testid="milestone-edit"]')).to have_selector('.gl-new-dropdown-inner')
+ end
+ end
+
+ describe 'pressing "m"' do
+ describe 'On an Issue' do
+ before do
+ visit project_issue_path(project, issue)
+ wait_for_requests
+ end
+
+ include_examples 'opens milestones dropdown for editing'
+ end
+
+ describe 'On a Merge Request' do
+ before do
+ visit project_merge_request_path(project, merge_request)
+ wait_for_requests
+ end
+
+ include_examples 'opens milestones dropdown for editing'
+ end
+ end
+
+ shared_examples "opens labels dropdown for editing" do
+ it "opens labels dropdown for editing" do
+ find('body').native.send_key('l')
+
+ expect(find('.js-labels-block')).to have_selector('[data-testid="labels-select-dropdown-contents"]')
+ end
+ end
+
+ describe 'pressing "l"' do
+ describe 'On an Issue' do
+ before do
+ visit project_issue_path(project, issue)
+ wait_for_requests
+ end
+
+ include_examples 'opens labels dropdown for editing'
+ end
+
+ describe 'On a Merge Request' do
+ before do
+ visit project_merge_request_path(project, merge_request)
+ wait_for_requests
+ end
+
+ include_examples 'opens labels dropdown for editing'
+ end
+ end
end
diff --git a/spec/features/issuables/sorting_list_spec.rb b/spec/features/issuables/sorting_list_spec.rb
index 6e07c6ffed2..f646cdbd71b 100644
--- a/spec/features/issuables/sorting_list_spec.rb
+++ b/spec/features/issuables/sorting_list_spec.rb
@@ -197,17 +197,13 @@ RSpec.describe 'Sort Issuable List' do
click_button('Created date')
click_on('Last updated')
- wait_for_requests
-
- expect(first_issue).to include(last_updated_issuable.title)
- expect(last_issue).to include(first_updated_issuable.title)
+ expect(page).to have_css('.issue:first-child', text: last_updated_issuable.title)
+ expect(page).to have_css('.issue:last-child', text: first_updated_issuable.title)
click_on 'Sort direction'
- wait_for_requests
-
- expect(first_issue).to include(first_updated_issuable.title)
- expect(last_issue).to include(last_updated_issuable.title)
+ expect(page).to have_css('.issue:first-child', text: first_updated_issuable.title)
+ expect(page).to have_css('.issue:last-child', text: last_updated_issuable.title)
end
end
end