diff options
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/filtered_search/dropdown_assignee_spec.rb | 34 | ||||
-rw-r--r-- | spec/features/issues/incident_issue_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/note_polling_spec.rb | 20 | ||||
-rw-r--r-- | spec/features/issues/service_desk_spec.rb | 38 | ||||
-rw-r--r-- | spec/features/issues/user_creates_branch_and_merge_request_spec.rb | 19 | ||||
-rw-r--r-- | spec/features/issues/user_edits_issue_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/issues/user_toggles_subscription_spec.rb | 6 | ||||
-rw-r--r-- | spec/features/issues/user_views_issue_spec.rb | 38 |
8 files changed, 107 insertions, 58 deletions
diff --git a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb index 57270e8f7c7..0a06a052bc2 100644 --- a/spec/features/issues/filtered_search/dropdown_assignee_spec.rb +++ b/spec/features/issues/filtered_search/dropdown_assignee_spec.rb @@ -92,7 +92,7 @@ RSpec.describe 'Dropdown assignee', :js, feature_category: :team_planning do sign_in(subgroup_user) end - it 'shows inherited, direct, and invited group members but not descendent members', :aggregate_failures do + it 'shows inherited, direct, and invited group members including descendent members', :aggregate_failures do visit issues_group_path(subgroup) select_tokens 'Assignee', '=' @@ -100,8 +100,8 @@ RSpec.describe 'Dropdown assignee', :js, feature_category: :team_planning do expect(page).to have_text group_user.name expect(page).to have_text subgroup_user.name expect(page).to have_text invited_to_group_group_user.name - expect(page).not_to have_text subsubgroup_user.name - expect(page).not_to have_text invited_to_project_group_user.name + expect(page).to have_text subsubgroup_user.name + expect(page).to have_text invited_to_project_group_user.name visit project_issues_path(subgroup_project) @@ -113,5 +113,33 @@ RSpec.describe 'Dropdown assignee', :js, feature_category: :team_planning do expect(page).to have_text invited_to_group_group_user.name expect(page).not_to have_text subsubgroup_user.name end + + context 'when new_graphql_users_autocomplete is disabled' do + before do + stub_feature_flags(new_graphql_users_autocomplete: false) + end + + it 'shows inherited, direct, and invited group members but not descendent members', :aggregate_failures do + visit issues_group_path(subgroup) + + select_tokens 'Assignee', '=' + + expect(page).to have_text group_user.name + expect(page).to have_text subgroup_user.name + expect(page).to have_text invited_to_group_group_user.name + expect(page).not_to have_text subsubgroup_user.name + expect(page).not_to have_text invited_to_project_group_user.name + + visit project_issues_path(subgroup_project) + + select_tokens 'Assignee', '=' + + expect(page).to have_text group_user.name + expect(page).to have_text subgroup_user.name + expect(page).to have_text invited_to_project_group_user.name + expect(page).to have_text invited_to_group_group_user.name + expect(page).not_to have_text subsubgroup_user.name + end + end end end diff --git a/spec/features/issues/incident_issue_spec.rb b/spec/features/issues/incident_issue_spec.rb index 145b51d207a..5197f5d1e33 100644 --- a/spec/features/issues/incident_issue_spec.rb +++ b/spec/features/issues/incident_issue_spec.rb @@ -70,10 +70,6 @@ RSpec.describe 'Incident Detail', :js, feature_category: :team_planning do # 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"]', wait: false) - expect(edit_button.count).to eq(0) end end end diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb index 23f9347d726..a390dca6822 100644 --- a/spec/features/issues/note_polling_spec.rb +++ b/spec/features/issues/note_polling_spec.rb @@ -10,17 +10,31 @@ RSpec.describe 'Issue notes polling', :js, feature_category: :team_planning do let(:issue) { create(:issue, project: project) } describe 'creates' do - before do + it 'displays the new comment' do visit project_issue_path(project, issue) close_rich_text_promo_popover_if_present - end - it 'displays the new comment' do note = create(:note, noteable: issue, project: project, note: 'Looks good!') wait_for_requests expect(page).to have_selector("#note_#{note.id}", text: 'Looks good!') end + + context 'when action_cable_notes is disabled' do + before do + stub_feature_flags(action_cable_notes: false) + end + + it 'displays the new comment' do + visit project_issue_path(project, issue) + close_rich_text_promo_popover_if_present + + note = create(:note, noteable: issue, project: project, note: 'Looks good!') + wait_for_requests + + expect(page).to have_selector("#note_#{note.id}", text: 'Looks good!') + end + end end describe 'updates' do diff --git a/spec/features/issues/service_desk_spec.rb b/spec/features/issues/service_desk_spec.rb index 923967c52c0..1b99c8b39d3 100644 --- a/spec/features/issues/service_desk_spec.rb +++ b/spec/features/issues/service_desk_spec.rb @@ -184,6 +184,42 @@ RSpec.describe 'Service Desk Issue Tracker', :js, feature_category: :service_des stub_feature_flags(frontend_caching: true) end + context 'when there are no issues' do + describe 'service desk empty state' do + it 'displays the large empty state, documentation, and the email address' do + visit service_desk_project_issues_path(project) + + aggregate_failures do + expect(page).to have_css('.empty-state') + expect(page).to have_text('Use Service Desk to connect with your users') + expect(page).to have_link('Learn more about Service Desk', href: help_page_path('user/project/service_desk/index')) + expect(page).not_to have_link('Enable Service Desk') + expect(page).to have_content(project.service_desk_address) + end + end + + context 'when user does not have permission to edit project settings' do + before do + user_2 = create(:user) + + project.add_guest(user_2) + sign_in(user_2) + visit service_desk_project_issues_path(project) + end + + it 'displays the large info box and the documentation link' do + aggregate_failures do + expect(page).to have_css('.empty-state') + expect(page).to have_text('Use Service Desk to connect with your users') + expect(page).to have_link('Learn more about Service Desk', href: help_page_path('user/project/service_desk/index')) + expect(page).not_to have_link('Enable Service Desk') + expect(page).not_to have_content(project.service_desk_address) + end + end + end + end + end + context 'when there are issues' do let_it_be(:project) { create(:project, :private, service_desk_enabled: true) } let_it_be(:other_user) { create(:user) } @@ -197,7 +233,7 @@ RSpec.describe 'Service Desk Issue Tracker', :js, feature_category: :service_des it 'displays the small info box, documentation, a button to configure service desk, and the address' do aggregate_failures do - expect(page).to have_link('Learn more', href: help_page_path('user/project/service_desk')) + expect(page).to have_link('Learn more about Service Desk', href: help_page_path('user/project/service_desk/index')) expect(page).not_to have_link('Enable Service Desk') expect(page).to have_content(project.service_desk_address) end diff --git a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb index ecb899a7ca2..0c50b7b2475 100644 --- a/spec/features/issues/user_creates_branch_and_merge_request_spec.rb +++ b/spec/features/issues/user_creates_branch_and_merge_request_spec.rb @@ -112,6 +112,18 @@ RSpec.describe 'User creates branch and merge request on issue page', :js, featu expect(page).to have_selector('.ref-selector', text: branch_name) expect(page).to have_current_path project_tree_path(project, branch_name), ignore_query: true end + + context 'when source branch is non-default' do + let(:source_branch) { 'feature' } + + it 'creates a branch' do + select_dropdown_option('create-branch', branch_name, source_branch) + wait_for_requests + + expect(page).to have_selector('.ref-selector', text: branch_name) + expect(page).to have_current_path project_tree_path(project, branch_name), ignore_query: true + end + end end context 'when branch name is invalid' do @@ -231,12 +243,13 @@ RSpec.describe 'User creates branch and merge request on issue page', :js, featu private - def select_dropdown_option(option, branch_name = nil) + def select_dropdown_option(option, branch_name = nil, source_branch = nil) find('.create-mr-dropdown-wrap .dropdown-toggle').click find("li[data-value='#{option}']").click - if branch_name - find('.js-branch-name').set(branch_name) + if branch_name || source_branch + find('.js-branch-name').set(branch_name) if branch_name + find('.js-ref').set(source_branch) if source_branch # Javascript debounces AJAX calls. # So we have to wait until AJAX requests are started. diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb index 0938f9c7d12..45d95db8ff1 100644 --- a/spec/features/issues/user_edits_issue_spec.rb +++ b/spec/features/issues/user_edits_issue_spec.rb @@ -130,7 +130,7 @@ RSpec.describe "Issues > User edits issue", :js, feature_category: :team_plannin click_button("Switch to rich text editing") end - expect(issuable_form).not_to have_selector(content_editor_focused_selector) + expect(issuable_form).to have_selector(content_editor_focused_selector) refresh @@ -142,11 +142,11 @@ RSpec.describe "Issues > User edits issue", :js, feature_category: :team_plannin click_button("Switch to plain text editing") end - expect(issuable_form).not_to have_selector(markdown_field_focused_selector) + expect(issuable_form).to have_selector(markdown_field_focused_selector) end end - describe 'update labels' do + describe 'update labels', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/345229' do it 'will not send ajax request when no data is changed' do page.within '.labels' do click_on 'Edit' diff --git a/spec/features/issues/user_toggles_subscription_spec.rb b/spec/features/issues/user_toggles_subscription_spec.rb index 00b04c10d33..af8a31afd5f 100644 --- a/spec/features/issues/user_toggles_subscription_spec.rb +++ b/spec/features/issues/user_toggles_subscription_spec.rb @@ -34,7 +34,7 @@ RSpec.describe "User toggles subscription", :js, feature_category: :team_plannin expect(subscription_button).to have_css("button.is-checked") # Toggle subscription. - find('[data-testid="subscription-toggle"]').click + subscription_button.find('button').click wait_for_requests # Check we're unsubscribed. @@ -42,7 +42,7 @@ RSpec.describe "User toggles subscription", :js, feature_category: :team_plannin end context 'when project emails are disabled' do - let(:project) { create(:project_empty_repo, :public, emails_disabled: true) } + let_it_be(:project) { create(:project_empty_repo, :public, emails_enabled: false) } it 'is disabled' do expect(page).to have_content('Disabled by project owner') @@ -66,7 +66,7 @@ RSpec.describe "User toggles subscription", :js, feature_category: :team_plannin expect(subscription_button).to have_css("button:not(.is-checked)") # Toggle subscription. - find('[data-testid="subscription-toggle"]').click + subscription_button.find('button').click wait_for_requests # Check we're subscribed. diff --git a/spec/features/issues/user_views_issue_spec.rb b/spec/features/issues/user_views_issue_spec.rb index 17ff3e0c702..00aa7685e9d 100644 --- a/spec/features/issues/user_views_issue_spec.rb +++ b/spec/features/issues/user_views_issue_spec.rb @@ -39,42 +39,4 @@ RSpec.describe "User views issue", feature_category: :team_planning do expect(page).not_to have_link('Close issue') end end - - describe 'user status' do - subject { visit(project_issue_path(project, issue)) } - - context 'when showing status of the author of the issue' do - it_behaves_like 'showing user status' do - let(:user_with_status) { user } - end - end - - context 'when showing status of a user who commented on an issue', :js do - it_behaves_like 'showing user status' do - let(:user_with_status) { user } - end - end - - context 'when status message has an emoji', :js do - let_it_be(:message) { 'My status with an emoji' } - let_it_be(:message_emoji) { 'basketball' } - let_it_be(:status) { create(:user_status, user: user, emoji: 'smirk', message: "#{message} :#{message_emoji}:") } - - it 'correctly renders the emoji' do - wait_for_requests - - tooltip_span = page.first(".user-status-emoji[title^='#{message}']") - - tooltip_span.hover - - wait_for_requests - - tooltip = page.find('.tooltip .tooltip-inner') - - page.within(tooltip) do - expect(page).to have_emoji(message_emoji) - end - end - end - end end |