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:
Diffstat (limited to 'spec/features/issues/form_spec.rb')
-rw-r--r--spec/features/issues/form_spec.rb85
1 files changed, 37 insertions, 48 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb
index 5f7a4f26a98..ed2c712feb1 100644
--- a/spec/features/issues/form_spec.rb
+++ b/spec/features/issues/form_spec.rb
@@ -8,14 +8,13 @@ RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do
include ContentEditorHelpers
let_it_be(:project) { create(:project, :repository) }
- let_it_be(:user) { create(:user) }
- let_it_be(:user2) { create(:user) }
- let_it_be(:guest) { create(:user) }
+ let_it_be(:user) { create(:user, :no_super_sidebar) }
+ let_it_be(:user2) { create(:user, :no_super_sidebar) }
+ let_it_be(:guest) { create(:user, :no_super_sidebar) }
let_it_be(:milestone) { create(:milestone, project: project) }
let_it_be(:label) { create(:label, project: project) }
let_it_be(:label2) { create(:label, project: project) }
let_it_be(:issue) { create(:issue, project: project, assignees: [user], milestone: milestone) }
- let_it_be(:issue2) { create(:issue, project: project, assignees: [user], milestone: milestone) }
let_it_be(:confidential_issue) { create(:issue, project: project, assignees: [user], milestone: milestone, confidential: true) }
let(:current_user) { user }
@@ -666,69 +665,59 @@ RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do
end
end
- describe 'inline edit' do
- context 'within issue 1' do
- before do
- visit project_issue_path(project, issue)
- wait_for_requests
- end
+ describe 'editing an issue by hotkey' do
+ let_it_be(:issue2) { create(:issue, project: project) }
- it 'opens inline edit form with shortcut' do
- find('body').send_keys('e')
+ before do
+ visit project_issue_path(project, issue2)
+ end
- expect(page).to have_selector('.detail-page-description form')
- end
+ it 'opens inline edit form with shortcut' do
+ find('body').send_keys('e')
- describe 'when user has made no changes' do
- it 'let user leave the page without warnings' do
- expected_content = 'Issue created'
- expect(page).to have_content(expected_content)
+ expect(page).to have_selector('.detail-page-description form')
+ end
- find('body').send_keys('e')
+ context 'when user has made no changes' do
+ it 'let user leave the page without warnings' do
+ expected_content = 'Issue created'
+ expect(page).to have_content(expected_content)
- click_link 'Boards'
+ find('body').send_keys('e')
- expect(page).not_to have_content(expected_content)
- end
- end
+ click_link 'Boards'
- describe 'when user has made changes' do
- it 'shows a warning and can stay on page', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/397683' do
- content = 'new issue content'
+ expect(page).not_to have_content(expected_content)
+ end
+ end
- find('body').send_keys('e')
- fill_in 'issue-description', with: content
+ context 'when user has made changes' do
+ it 'shows a warning and can stay on page' do
+ content = 'new issue content'
- click_link 'Boards'
+ find('body').send_keys('e')
+ fill_in 'issue-description', with: content
+ click_link 'Boards' do
page.driver.browser.switch_to.alert.dismiss
-
- click_button 'Save changes'
- wait_for_requests
-
- expect(page).to have_content(content)
end
- end
- end
- context 'within issue 2' do
- before do
- visit project_issue_path(project, issue2)
+ click_button 'Save changes'
wait_for_requests
- end
- describe 'when user has made changes' do
- it 'shows a warning and can leave page', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/410497' do
- content = 'new issue content'
- find('body').send_keys('e')
- fill_in 'issue-description', with: content
+ expect(page).to have_content(content)
+ end
- click_link 'Boards'
+ it 'shows a warning and can leave page' do
+ content = 'new issue content'
+ find('body').send_keys('e')
+ fill_in 'issue-description', with: content
+ click_link 'Boards' do
page.driver.browser.switch_to.alert.accept
-
- expect(page).not_to have_content(content)
end
+
+ expect(page).not_to have_content(content)
end
end
end