diff options
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/form_spec.rb | 7 | ||||
-rw-r--r-- | spec/features/issues/gfm_autocomplete_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/incident_issue_spec.rb | 70 | ||||
-rw-r--r-- | spec/features/issues/issue_sidebar_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/related_issues_spec.rb | 20 | ||||
-rw-r--r-- | spec/features/issues/todo_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/user_bulk_edits_issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/user_creates_issue_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/user_edits_issue_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/issues/user_interacts_with_awards_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/user_uses_quick_actions_spec.rb | 2 |
11 files changed, 54 insertions, 75 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 0700423983f..e749c555dcf 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -319,6 +319,13 @@ RSpec.describe 'New/edit issue', :js do end end end + + describe 'when repository contains CONTRIBUTING.md' do + it 'has contribution guidelines prompt' do + text = _('Please review the %{linkStart}contribution guidelines%{linkEnd} for this project.') % { linkStart: nil, linkEnd: nil } + expect(find('#new_issue')).to have_text(text) + end + end end describe 'new issue with query parameters' do diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 8732e2ecff2..fa4ce6fe1c1 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -414,7 +414,7 @@ RSpec.describe 'GFM autocomplete', :js do it 'shows all contacts' do page.within(find_autocomplete_menu) do - expected_data = contacts.map { |c| "#{c.first_name} #{c.last_name} #{c.email}"} + expected_data = contacts.map { |c| "#{c.first_name} #{c.last_name} #{c.email}" } expect(page.all('li').map(&:text)).to match_array(expected_data) end diff --git a/spec/features/issues/incident_issue_spec.rb b/spec/features/issues/incident_issue_spec.rb index d6ec7f1c539..56be1493ed2 100644 --- a/spec/features/issues/incident_issue_spec.rb +++ b/spec/features/issues/incident_issue_spec.rb @@ -30,7 +30,7 @@ RSpec.describe 'Incident Detail', :js do project.add_developer(user) sign_in(user) - visit project_issue_path(project, incident) + visit project_issues_incident_path(project, incident) wait_for_requests end @@ -49,72 +49,32 @@ RSpec.describe 'Incident Detail', :js do expect(incident_tabs).to have_content('Original alert: #1') end - aggregate_failures 'shows the Alert details tab' do - click_link 'Alert details' - - expect(incident_tabs).to have_content('"title": "Alert title"') - expect(incident_tabs).to have_content('"yet.another": 73') - end - end - end - - context 'when on summary tab' do - before do - click_link 'Summary' - end - - it 'shows the summary tab with all components' do - page.within('.issuable-details') do + aggregate_failures 'when on summary tab (default tab)' do hidden_items = find_all('.js-issue-widgets') # Linked Issues/MRs and comment box expect(hidden_items.count).to eq(2) - expect(hidden_items).to all(be_visible) - end - end - - it 'shows the edit title and description button' do - edit_button = find_all('[aria-label="Edit title and description"]') - - expect(edit_button).to all(be_visible) - end - end - - context 'when on alert details tab' do - before do - click_link 'Alert details' - end - - it 'does not show the linked issues and notes/comment components' do - page.within('.issuable-details') do - hidden_items = find_all('.js-issue-widgets') - # Linked Issues/MRs and comment box are hidden on page - expect(hidden_items.count).to eq(0) + edit_button = find_all('[aria-label="Edit title and description"]') + expect(edit_button).to all(be_visible) end - end - it 'does not show the edit title and description button' do - edit_button = find_all('[aria-label="Edit title and description"]') - - expect(edit_button.count).to eq(0) - end - end + aggregate_failures 'shows the Alert details tab' do + click_link 'Alert details' - context 'when on timeline events tab from incident route' do - before do - visit project_issues_incident_path(project, incident) - wait_for_requests - click_link 'Timeline' - end + expect(incident_tabs).to have_content('"title": "Alert title"') + expect(incident_tabs).to have_content('"yet.another": 73') - it 'does not show the linked issues and notes/comment components' do - page.within('.issuable-details') do + # does not show the linked issues and notes/comment components' do hidden_items = find_all('.js-issue-widgets') # Linked Issues/MRs and comment box are hidden on page expect(hidden_items.count).to eq(0) + + # does not show the edit title and description button + edit_button = find_all('[aria-label="Edit title and description"]') + expect(edit_button.count).to eq(0) end end end @@ -126,7 +86,7 @@ RSpec.describe 'Incident Detail', :js do click_link 'Timeline' end - it 'does not show the linked issues and notes/comment commponents' do + it 'does not show the linked issues and notes/comment components' do page.within('.issuable-details') do hidden_items = find_all('.js-issue-widgets') @@ -140,7 +100,7 @@ RSpec.describe 'Incident Detail', :js do before do stub_feature_flags(incident_timeline: false) - visit project_issue_path(project, incident) + visit project_issues_incident_path(project, incident) wait_for_requests end diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index aaa478378a9..8819f085a5f 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -84,8 +84,10 @@ RSpec.describe 'Issue Sidebar' do click_link user2.name end - find('.js-right-sidebar').click - find('.block.assignee .edit-link').click + within '.js-right-sidebar' do + find('.block.assignee').click(x: 0, y: 0) + find('.block.assignee .edit-link').click + end expect(page.all('.dropdown-menu-user li').length).to eq(1) expect(find('.dropdown-input-field').value).to eq(user2.name) @@ -182,7 +184,7 @@ RSpec.describe 'Issue Sidebar' do page.within '.dropdown-menu-user' do expect(page).not_to have_content 'Unassigned' - click_link user2.name + click_button user2.name end find('.participants').click diff --git a/spec/features/issues/related_issues_spec.rb b/spec/features/issues/related_issues_spec.rb index a95229d4f1b..818e99f2ec9 100644 --- a/spec/features/issues/related_issues_spec.rb +++ b/spec/features/issues/related_issues_spec.rb @@ -232,7 +232,9 @@ RSpec.describe 'Related issues', :js do it 'add related issue' do click_button 'Add a related issue' fill_in 'Paste issue link', with: "#{issue_b.to_reference(project)} " - click_button 'Add' + page.within('.linked-issues-card-body') do + click_button 'Add' + end wait_for_requests @@ -249,7 +251,9 @@ RSpec.describe 'Related issues', :js do it 'add cross-project related issue' do click_button 'Add a related issue' fill_in 'Paste issue link', with: "#{issue_project_b_a.to_reference(project)} " - click_button 'Add' + page.within('.linked-issues-card-body') do + click_button 'Add' + end wait_for_requests @@ -359,7 +363,9 @@ RSpec.describe 'Related issues', :js do it 'add related issue' do click_button 'Add a related issue' fill_in 'Paste issue link', with: "##{issue_d.iid} " - click_button 'Add' + page.within('.linked-issues-card-body') do + click_button 'Add' + end wait_for_requests @@ -375,7 +381,9 @@ RSpec.describe 'Related issues', :js do it 'add invalid related issue' do click_button 'Add a related issue' fill_in 'Paste issue link', with: '#9999999 ' - click_button 'Add' + page.within('.linked-issues-card-body') do + click_button 'Add' + end wait_for_requests @@ -390,7 +398,9 @@ RSpec.describe 'Related issues', :js do it 'add unauthorized related issue' do click_button 'Add a related issue' fill_in 'Paste issue link', with: "#{issue_project_unauthorized_a.to_reference(project)} " - click_button 'Add' + page.within('.linked-issues-card-body') do + click_button 'Add' + end wait_for_requests diff --git a/spec/features/issues/todo_spec.rb b/spec/features/issues/todo_spec.rb index d63d21353e5..6a53c12eda3 100644 --- a/spec/features/issues/todo_spec.rb +++ b/spec/features/issues/todo_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe 'Manually create a todo item from issue', :js do let!(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } - let!(:user) { create(:user)} + let!(:user) { create(:user) } before do project.add_maintainer(user) diff --git a/spec/features/issues/user_bulk_edits_issues_spec.rb b/spec/features/issues/user_bulk_edits_issues_spec.rb index 0533f1688e2..1ef2918adec 100644 --- a/spec/features/issues/user_bulk_edits_issues_spec.rb +++ b/spec/features/issues/user_bulk_edits_issues_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe 'Multiple issue updating from issues#index', :js do let!(:project) { create(:project) } let!(:issue) { create(:issue, project: project) } - let!(:user) { create(:user)} + let!(:user) { create(:user) } before do project.add_maintainer(user) diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index 151d3c60fa2..e29911e3263 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -151,7 +151,7 @@ RSpec.describe "User creates issue" do click_button 'Cancel' end - expect(page).to have_button('Attach a file') + expect(page).to have_selector('[data-testid="button-attach-file"]') expect(page).not_to have_button('Cancel') expect(page).not_to have_selector('.uploading-progress-container', visible: true) end @@ -188,7 +188,7 @@ RSpec.describe "User creates issue" do end it 'does not hide the milestone select' do - expect(page).to have_selector('.qa-issuable-milestone-dropdown') # rubocop:disable QA/SelectorUsage + expect(page).to have_selector('[data-testid="issuable-milestone-dropdown"]') end end @@ -204,7 +204,7 @@ RSpec.describe "User creates issue" do end it 'shows the milestone select' do - expect(page).to have_selector('.qa-issuable-milestone-dropdown') # rubocop:disable QA/SelectorUsage + expect(page).to have_selector('[data-testid="issuable-milestone-dropdown"]') end it 'hides the incident help text' do @@ -265,7 +265,7 @@ RSpec.describe "User creates issue" do end it 'shows the milestone select' do - expect(page).to have_selector('.qa-issuable-milestone-dropdown') # rubocop:disable QA/SelectorUsage + expect(page).to have_selector('[data-testid="issuable-milestone-dropdown"]') end it 'hides the weight input' do diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb index 3b440002cb5..4eecb63c47e 100644 --- a/spec/features/issues/user_edits_issue_spec.rb +++ b/spec/features/issues/user_edits_issue_spec.rb @@ -155,7 +155,7 @@ RSpec.describe "Issues > User edits issue", :js do page.within '.block.labels' do # Remove `verisimilitude` label - within '.gl-label' do + within '.gl-label', text: 'verisimilitude' do click_button 'Remove label' end @@ -285,7 +285,7 @@ RSpec.describe "Issues > User edits issue", :js do end page.within '.dropdown-menu-user' do - click_link user.name + click_button user.name end page.within('.assignee') do @@ -306,7 +306,7 @@ RSpec.describe "Issues > User edits issue", :js do click_button('Edit') wait_for_requests - click_link user.name + click_button user.name find('[data-testid="title"]').click wait_for_requests diff --git a/spec/features/issues/user_interacts_with_awards_spec.rb b/spec/features/issues/user_interacts_with_awards_spec.rb index 892b57bac5c..c86a2c32e2d 100644 --- a/spec/features/issues/user_interacts_with_awards_spec.rb +++ b/spec/features/issues/user_interacts_with_awards_spec.rb @@ -6,7 +6,7 @@ RSpec.describe 'User interacts with awards' do let(:user) { create(:user) } describe 'User interacts with awards in an issue', :js do - let(:issue) { create(:issue, project: project)} + let(:issue) { create(:issue, project: project) } let(:project) { create(:project) } before do diff --git a/spec/features/issues/user_uses_quick_actions_spec.rb b/spec/features/issues/user_uses_quick_actions_spec.rb index c6d743ed38f..d458c991668 100644 --- a/spec/features/issues/user_uses_quick_actions_spec.rb +++ b/spec/features/issues/user_uses_quick_actions_spec.rb @@ -18,7 +18,7 @@ RSpec.describe 'Issues > User uses quick actions', :js do let!(:label_feature) { create(:label, project: project, title: 'feature') } let!(:milestone) { create(:milestone, project: project, title: 'ASAP') } let(:issuable) { create(:issue, project: project) } - let(:source_issuable) { create(:issue, project: project, milestone: milestone, labels: [label_bug, label_feature])} + let(:source_issuable) { create(:issue, project: project, milestone: milestone, labels: [label_bug, label_feature]) } it_behaves_like 'close quick action', :issue it_behaves_like 'issuable time tracker', :issue |