diff options
Diffstat (limited to 'spec/features/issues')
9 files changed, 31 insertions, 10 deletions
diff --git a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb index 1e8b9b6b60b..a385e8a5fd0 100644 --- a/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_discussions_in_merge_request_spec.rb @@ -18,6 +18,10 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j end end + before do + stub_feature_flags(moved_mr_sidebar: false) + end + describe 'as a user with access to the project' do before do project.add_maintainer(user) @@ -26,14 +30,16 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j end it 'shows a button to resolve all threads by creating a new issue' do + find('.discussions-counter .dropdown-toggle').click + within('.discussions-counter') do - expect(page).to have_selector resolve_all_discussions_link_selector( title: "Create issue to resolve all threads" ) + expect(page).to have_link(_("Create issue to resolve all threads"), href: new_project_issue_path(project, merge_request_to_resolve_discussions_of: merge_request.iid)) end end context 'resolving the thread' do before do - find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage + find('button[data-testid="resolve-discussion-button"]').click end it 'hides the link for creating a new issue' do @@ -44,6 +50,7 @@ RSpec.describe 'Resolving all open threads in a merge request from an issue', :j context 'creating an issue for threads' do before do + find('.discussions-counter .dropdown-toggle').click find(resolve_all_discussions_link_selector).click end diff --git a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb index 0de15d3d304..5ff61a52b21 100644 --- a/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb +++ b/spec/features/issues/create_issue_for_single_discussion_in_merge_request_spec.rb @@ -35,7 +35,7 @@ RSpec.describe 'Resolve an open thread in a merge request by creating an issue', context 'resolving the thread' do before do - find('button[data-qa-selector="resolve_discussion_button"]').click # rubocop:disable QA/SelectorUsage + find('button[data-testid="resolve-discussion-button"]').click end it 'hides the link for creating a new issue' do diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb index 2af54e51bb7..a253e6f4c86 100644 --- a/spec/features/issues/issue_detail_spec.rb +++ b/spec/features/issues/issue_detail_spec.rb @@ -68,8 +68,12 @@ RSpec.describe 'Issue Detail', :js do end context 'when edited by a user who is later deleted' do + let(:user_to_be_deleted) { create(:user) } + before do - sign_in(user) + project.add_developer(user_to_be_deleted) + + sign_in(user_to_be_deleted) visit project_issue_path(project, issue) wait_for_requests @@ -78,8 +82,9 @@ RSpec.describe 'Issue Detail', :js do click_button 'Save changes' wait_for_requests - Users::DestroyService.new(user).execute(user) + Users::DestroyService.new(user_to_be_deleted).execute(user_to_be_deleted) + sign_in(user) visit project_issue_path(project, issue) end diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 8819f085a5f..6fa8a52a9c5 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -302,7 +302,9 @@ RSpec.describe 'Issue Sidebar' do context 'sidebar', :js do it 'finds issue copy forwarding email' do - expect(find('[data-qa-selector="copy-forward-email"]').text).to eq "Issue email: #{issue.creatable_note_email_address(user)}" # rubocop:disable QA/SelectorUsage + expect( + find('[data-testid="copy-forward-email"]').text + ).to eq "Issue email: #{issue.creatable_note_email_address(user)}" end end @@ -338,7 +340,7 @@ RSpec.describe 'Issue Sidebar' do end it 'does not find issue email' do - expect(page).not_to have_selector('[data-qa-selector="copy-forward-email"]') # rubocop:disable QA/SelectorUsage + expect(page).not_to have_selector('[data-testid="copy-forward-email"]') end end end diff --git a/spec/features/issues/resource_label_events_spec.rb b/spec/features/issues/resource_label_events_spec.rb index e08410efc0b..e4da2f67516 100644 --- a/spec/features/issues/resource_label_events_spec.rb +++ b/spec/features/issues/resource_label_events_spec.rb @@ -14,6 +14,7 @@ RSpec.describe 'List issue resource label events', :js do let!(:event) { create(:resource_label_event, user: user, issue: issue, label: label) } before do + stub_feature_flags(remove_user_attributes_projects: false) visit project_issue_path(project, issue) wait_for_requests end diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index e29911e3263..b96490bd7e7 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -269,7 +269,7 @@ RSpec.describe "User creates issue" do end it 'hides the weight input' do - expect(page).not_to have_selector('.qa-issuable-weight-input') # rubocop:disable QA/SelectorUsage + expect(page).not_to have_selector('[data-testid="issuable-weight-input"]') end it 'shows the incident help text' do diff --git a/spec/features/issues/user_interacts_with_awards_spec.rb b/spec/features/issues/user_interacts_with_awards_spec.rb index c86a2c32e2d..8ed56108f00 100644 --- a/spec/features/issues/user_interacts_with_awards_spec.rb +++ b/spec/features/issues/user_interacts_with_awards_spec.rb @@ -3,6 +3,8 @@ require 'spec_helper' RSpec.describe 'User interacts with awards' do + include MobileHelpers + let(:user) { create(:user) } describe 'User interacts with awards in an issue', :js do @@ -130,6 +132,7 @@ RSpec.describe 'User interacts with awards' do end it 'allows adding a new emoji' do + resize_window(1200, 800) page.within('.note-actions') do find('.note-emoji-button').click end @@ -140,6 +143,7 @@ RSpec.describe 'User interacts with awards' do expect(page).to have_emoji('8ball') end expect(note.reload.award_emoji.size).to eq(2) + restore_window_size end context 'when the project is archived' do diff --git a/spec/features/issues/user_sees_empty_state_spec.rb b/spec/features/issues/user_sees_empty_state_spec.rb index b43ba01606a..0e2a7cb4358 100644 --- a/spec/features/issues/user_sees_empty_state_spec.rb +++ b/spec/features/issues/user_sees_empty_state_spec.rb @@ -40,8 +40,8 @@ RSpec.describe 'Issues > User sees empty state', :js do it 'user sees empty state' do visit project_issues_path(project) - expect(page).to have_content('The Issue Tracker is the place to add things that need to be improved or solved in a project') - expect(page).to have_content('Issues can be bugs, tasks or ideas to be discussed. Also, issues are searchable and filterable.') + expect(page).to have_content('Use issues to collaborate on ideas, solve problems, and plan work') + expect(page).to have_content('Learn more about issues.') expect(page).to have_content('New issue') end diff --git a/spec/features/issues/user_sorts_issue_comments_spec.rb b/spec/features/issues/user_sorts_issue_comments_spec.rb index 555f8827374..4b38ce329b8 100644 --- a/spec/features/issues/user_sorts_issue_comments_spec.rb +++ b/spec/features/issues/user_sorts_issue_comments_spec.rb @@ -16,7 +16,9 @@ RSpec.describe 'Comment sort direction' do it 'saves sort order' do # open dropdown, and select 'Newest first' page.within('.issuable-details') do + find('#discussion-preferences-dropdown').click click_button('Oldest first') + find('#discussion-preferences-dropdown').click click_button('Newest first') end |