Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-11-17 14:33:21 +0300
commit7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch)
tree5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/features/issues/user_edits_issue_spec.rb
parent185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff)
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/features/issues/user_edits_issue_spec.rb')
-rw-r--r--spec/features/issues/user_edits_issue_spec.rb33
1 files changed, 31 insertions, 2 deletions
diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb
index 4eecb63c47e..75df85f362f 100644
--- a/spec/features/issues/user_edits_issue_spec.rb
+++ b/spec/features/issues/user_edits_issue_spec.rb
@@ -101,6 +101,35 @@ RSpec.describe "Issues > User edits issue", :js do
visit project_issue_path(project, issue)
end
+ describe 'edit description' do
+ def click_edit_issue_description
+ click_on 'Edit title and description'
+ end
+
+ it 'places focus on the web editor' do
+ toggle_editing_mode_selector = '[data-testid="toggle-editing-mode-button"] label'
+ content_editor_focused_selector = '[data-testid="content-editor"].is-focused'
+ markdown_field_focused_selector = 'textarea:focus'
+ click_edit_issue_description
+
+ expect(page).to have_selector(markdown_field_focused_selector)
+
+ find(toggle_editing_mode_selector, text: 'Rich text').click
+
+ expect(page).not_to have_selector(content_editor_focused_selector)
+
+ refresh
+
+ click_edit_issue_description
+
+ expect(page).to have_selector(content_editor_focused_selector)
+
+ find(toggle_editing_mode_selector, text: 'Source').click
+
+ expect(page).not_to have_selector(markdown_field_focused_selector)
+ end
+ end
+
describe 'update labels' do
it 'will not send ajax request when no data is changed' do
page.within '.labels' do
@@ -186,7 +215,7 @@ RSpec.describe "Issues > User edits issue", :js do
visit project_issue_path(project, issue)
page.within('.assignee') do
- expect(page).to have_content "#{user.name}"
+ expect(page).to have_content user.name.to_s
click_link 'Edit'
click_link 'Unassigned'
@@ -261,7 +290,7 @@ RSpec.describe "Issues > User edits issue", :js do
visit project_issue_path(project, issue)
page.within('.assignee') do
- expect(page).to have_content "#{user.name}"
+ expect(page).to have_content user.name.to_s
click_button('Edit')
wait_for_requests