diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/features/issues | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/features/issues')
-rw-r--r-- | spec/features/issues/bulk_assignment_labels_spec.rb | 45 | ||||
-rw-r--r-- | spec/features/issues/filtered_search/filter_issues_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/filtered_search/search_bar_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/gfm_autocomplete_spec.rb | 752 | ||||
-rw-r--r-- | spec/features/issues/issue_detail_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/issue_sidebar_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/move_spec.rb | 39 | ||||
-rw-r--r-- | spec/features/issues/service_desk_spec.rb | 163 | ||||
-rw-r--r-- | spec/features/issues/update_issues_spec.rb | 1 | ||||
-rw-r--r-- | spec/features/issues/user_creates_branch_and_merge_request_spec.rb | 8 | ||||
-rw-r--r-- | spec/features/issues/user_filters_issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/user_interacts_with_awards_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/user_sees_breadcrumb_links_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/user_sees_empty_state_spec.rb | 4 | ||||
-rw-r--r-- | spec/features/issues/user_sorts_issues_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/issues/user_views_issues_spec.rb | 29 |
16 files changed, 768 insertions, 297 deletions
diff --git a/spec/features/issues/bulk_assignment_labels_spec.rb b/spec/features/issues/bulk_assignment_labels_spec.rb index 84a786e91a7..91f0e983fa8 100644 --- a/spec/features/issues/bulk_assignment_labels_spec.rb +++ b/spec/features/issues/bulk_assignment_labels_spec.rb @@ -5,14 +5,18 @@ require 'spec_helper' RSpec.describe 'Issues > Labels bulk assignment' do let(:user) { create(:user) } let!(:project) { create(:project) } - let!(:issue1) { create(:issue, project: project, title: "Issue 1") } - let!(:issue2) { create(:issue, project: project, title: "Issue 2") } let!(:bug) { create(:label, project: project, title: 'bug') } let!(:feature) { create(:label, project: project, title: 'feature') } + let!(:frontend) { create(:label, project: project, title: 'frontend') } let!(:wontfix) { create(:label, project: project, title: 'wontfix') } + let!(:issue1) { create(:issue, project: project, title: "Issue 1", labels: [frontend]) } + let!(:issue2) { create(:issue, project: project, title: "Issue 2") } context 'as an allowed user', :js do before do + # Make sure that issuables list FF is not turned on. + stub_feature_flags(vue_issuables_list: false) + project.add_maintainer(user) sign_in user @@ -48,11 +52,29 @@ RSpec.describe 'Issues > Labels bulk assignment' do it do expect(find("#issue_#{issue1.id}")).to have_content 'bug' + expect(find("#issue_#{issue1.id}")).to have_content 'frontend' expect(find("#issue_#{issue2.id}")).to have_content 'bug' + expect(find("#issue_#{issue2.id}")).not_to have_content 'frontend' end end - context 'to a issue' do + context 'to some issues' do + before do + check "selected_issue_#{issue1.id}" + check "selected_issue_#{issue2.id}" + open_labels_dropdown ['bug'] + update_issues + end + + it do + expect(find("#issue_#{issue1.id}")).to have_content 'bug' + expect(find("#issue_#{issue1.id}")).to have_content 'frontend' + expect(find("#issue_#{issue2.id}")).to have_content 'bug' + expect(find("#issue_#{issue2.id}")).not_to have_content 'frontend' + end + end + + context 'to an issue' do before do check "selected_issue_#{issue1.id}" open_labels_dropdown ['bug'] @@ -61,7 +83,24 @@ RSpec.describe 'Issues > Labels bulk assignment' do it do expect(find("#issue_#{issue1.id}")).to have_content 'bug' + expect(find("#issue_#{issue1.id}")).to have_content 'frontend' + expect(find("#issue_#{issue2.id}")).not_to have_content 'bug' + expect(find("#issue_#{issue2.id}")).not_to have_content 'frontend' + end + end + + context 'to an issue by selecting the label first' do + before do + open_labels_dropdown ['bug'] + check "selected_issue_#{issue1.id}" + update_issues + end + + it do + expect(find("#issue_#{issue1.id}")).to have_content 'bug' + expect(find("#issue_#{issue1.id}")).to have_content 'frontend' expect(find("#issue_#{issue2.id}")).not_to have_content 'bug' + expect(find("#issue_#{issue2.id}")).not_to have_content 'frontend' end end end diff --git a/spec/features/issues/filtered_search/filter_issues_spec.rb b/spec/features/issues/filtered_search/filter_issues_spec.rb index 5b5348d4069..080943da185 100644 --- a/spec/features/issues/filtered_search/filter_issues_spec.rb +++ b/spec/features/issues/filtered_search/filter_issues_spec.rb @@ -20,9 +20,7 @@ RSpec.describe 'Filter issues', :js do let!(:milestone) { create(:milestone, title: "8", project: project, start_date: 2.days.ago) } def expect_no_issues_list - page.within '.issues-list' do - expect(page).to have_no_selector('.issue') - end + expect(page).to have_no_selector('.issue') end before do @@ -88,7 +86,7 @@ RSpec.describe 'Filter issues', :js do end it 'does not have the != option' do - input_filtered_search("label:", submit: false) + input_filtered_search("label:", submit: false, extra_space: false) wait_for_requests within('#js-dropdown-operator') do @@ -344,7 +342,7 @@ RSpec.describe 'Filter issues', :js do context 'issue label clicked' do it 'filters and displays in search bar' do - find('.issues-list .issue .issuable-main-info .issuable-info a .gl-label-text', text: multiple_words_label.title).click + find('[data-qa-selector="issuable-label"]', text: multiple_words_label.title).click expect_issues_list_count(1) expect_tokens([label_token("\"#{multiple_words_label.title}\"")]) diff --git a/spec/features/issues/filtered_search/search_bar_spec.rb b/spec/features/issues/filtered_search/search_bar_spec.rb index 167fecc5ab1..2a094281133 100644 --- a/spec/features/issues/filtered_search/search_bar_spec.rb +++ b/spec/features/issues/filtered_search/search_bar_spec.rb @@ -88,7 +88,7 @@ RSpec.describe 'Search bar', :js do expect(find('#js-dropdown-hint')).to have_selector('.filter-dropdown .filter-dropdown-item', count: original_size) end - it 'resets the dropdown filters', :quarantine do + it 'resets the dropdown filters', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/9985' do filtered_search.click hint_offset = get_left_style(find('#js-dropdown-hint')['style']) diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 4a7e1ba99e9..0b2e8013304 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -3,455 +3,647 @@ require 'spec_helper' RSpec.describe 'GFM autocomplete', :js do - let(:issue_xss_title) { 'This will execute alert<img src=x onerror=alert(2)<img src=x onerror=alert(1)>' } - let(:user_xss_title) { 'eve <img src=x onerror=alert(2)<img src=x onerror=alert(1)>' } - let(:label_xss_title) { 'alert label <img src=x onerror="alert(\'Hello xss\');" a' } - let(:milestone_xss_title) { 'alert milestone <img src=x onerror="alert(\'Hello xss\');" a' } - - let(:user_xss) { create(:user, name: user_xss_title, username: 'xss.user') } - let(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } - let(:project) { create(:project) } - let(:label) { create(:label, project: project, title: 'special+') } + let_it_be(:user_xss_title) { 'eve <img src=x onerror=alert(2)<img src=x onerror=alert(1)>' } + let_it_be(:user_xss) { create(:user, name: user_xss_title, username: 'xss.user') } + let_it_be(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } + let_it_be(:project) { create(:project) } + let_it_be(:label) { create(:label, project: project, title: 'special+') } + let(:issue) { create(:issue, project: project) } - before do + before_all do project.add_maintainer(user) project.add_maintainer(user_xss) + end - sign_in(user) - visit project_issue_path(project, issue) + describe 'when tribute_autocomplete feature flag is off' do + before do + stub_feature_flags(tribute_autocomplete: false) - wait_for_requests - end + sign_in(user) + visit project_issue_path(project, issue) - it 'updates issue description with GFM reference' do - find('.js-issuable-edit').click + wait_for_requests + end - wait_for_requests + it 'updates issue description with GFM reference' do + find('.js-issuable-edit').click - simulate_input('#issue-description', "@#{user.name[0...3]}") + wait_for_requests - wait_for_requests + simulate_input('#issue-description', "@#{user.name[0...3]}") - find('.atwho-view .cur').click + wait_for_requests - click_button 'Save changes' + find('.atwho-view .cur').click - wait_for_requests + click_button 'Save changes' - expect(find('.description')).to have_content(user.to_reference) - end + wait_for_requests - it 'opens autocomplete menu when field starts with text' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('@') + expect(find('.description')).to have_content(user.to_reference) end - expect(page).to have_selector('.atwho-container') - end + it 'opens quick action autocomplete when updating description' do + find('.js-issuable-edit').click - it 'opens autocomplete menu for Issues when field starts with text with item escaping HTML characters' do - create(:issue, project: project, title: issue_xss_title) + find('#issue-description').native.send_keys('/') - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('#') + expect(page).to have_selector('.atwho-container') end - wait_for_requests - - expect(page).to have_selector('.atwho-container') + it 'opens autocomplete menu when field starts with text' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('@') + end - page.within '.atwho-container #at-view-issues' do - expect(page.all('li').first.text).to include(issue_xss_title) + expect(page).to have_selector('.atwho-container') end - end - it 'opens autocomplete menu for Username when field starts with text with item escaping HTML characters' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('@ev') - end + it 'opens autocomplete menu for Issues when field starts with text with item escaping HTML characters' do + issue_xss_title = 'This will execute alert<img src=x onerror=alert(2)<img src=x onerror=alert(1)>' + create(:issue, project: project, title: issue_xss_title) + + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('#') + end - wait_for_requests + wait_for_requests - expect(page).to have_selector('.atwho-container') + expect(page).to have_selector('.atwho-container') - page.within '.atwho-container #at-view-users' do - expect(find('li').text).to have_content(user_xss.username) + page.within '.atwho-container #at-view-issues' do + expect(page.all('li').first.text).to include(issue_xss_title) + end end - end - it 'opens autocomplete menu for Milestone when field starts with text with item escaping HTML characters' do - create(:milestone, project: project, title: milestone_xss_title) + it 'opens autocomplete menu for Username when field starts with text with item escaping HTML characters' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('@ev') + end + + wait_for_requests + + expect(page).to have_selector('.atwho-container') - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('%') + page.within '.atwho-container #at-view-users' do + expect(find('li').text).to have_content(user_xss.username) + end end - wait_for_requests + it 'opens autocomplete menu for Milestone when field starts with text with item escaping HTML characters' do + milestone_xss_title = 'alert milestone <img src=x onerror="alert(\'Hello xss\');" a' + create(:milestone, project: project, title: milestone_xss_title) + + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('%') + end + + wait_for_requests - expect(page).to have_selector('.atwho-container') + expect(page).to have_selector('.atwho-container') - page.within '.atwho-container #at-view-milestones' do - expect(find('li').text).to have_content('alert milestone') + page.within '.atwho-container #at-view-milestones' do + expect(find('li').text).to have_content('alert milestone') + end end - end - it 'doesnt open autocomplete menu character is prefixed with text' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('testing') - find('#note-body').native.send_keys('@') + it 'doesnt open autocomplete menu character is prefixed with text' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('testing') + find('#note-body').native.send_keys('@') + end + + expect(page).not_to have_selector('.atwho-view') end - expect(page).not_to have_selector('.atwho-view') - end + it 'doesnt select the first item for non-assignee dropdowns' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys(':') + end + + expect(page).to have_selector('.atwho-container') - it 'doesnt select the first item for non-assignee dropdowns' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys(':') + wait_for_requests + + expect(find('#at-view-58')).not_to have_selector('.cur:first-of-type') end - expect(page).to have_selector('.atwho-container') + it 'does not open autocomplete menu when ":" is prefixed by a number and letters' do + note = find('#note-body') - wait_for_requests + # Number. + page.within '.timeline-content-form' do + note.native.send_keys('7:') + end - expect(find('#at-view-58')).not_to have_selector('.cur:first-of-type') - end + expect(page).not_to have_selector('.atwho-view') - it 'does not open autocomplete menu when ":" is prefixed by a number and letters' do - note = find('#note-body') + # ASCII letter. + page.within '.timeline-content-form' do + note.set('') + note.native.send_keys('w:') + end - # Number. - page.within '.timeline-content-form' do - note.native.send_keys('7:') - end + expect(page).not_to have_selector('.atwho-view') - expect(page).not_to have_selector('.atwho-view') + # Non-ASCII letter. + page.within '.timeline-content-form' do + note.set('') + note.native.send_keys('Ё:') + end - # ASCII letter. - page.within '.timeline-content-form' do - note.set('') - note.native.send_keys('w:') + expect(page).not_to have_selector('.atwho-view') end - expect(page).not_to have_selector('.atwho-view') + it 'selects the first item for assignee dropdowns' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('@') + end - # Non-ASCII letter. - page.within '.timeline-content-form' do - note.set('') - note.native.send_keys('Ё:') - end + expect(page).to have_selector('.atwho-container') - expect(page).not_to have_selector('.atwho-view') - end + wait_for_requests - it 'selects the first item for assignee dropdowns' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('@') + expect(find('#at-view-users')).to have_selector('.cur:first-of-type') end - expect(page).to have_selector('.atwho-container') + it 'includes items for assignee dropdowns with non-ASCII characters in name' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('') + simulate_input('#note-body', "@#{user.name[0...8]}") + end - wait_for_requests + expect(page).to have_selector('.atwho-container') - expect(find('#at-view-users')).to have_selector('.cur:first-of-type') - end + wait_for_requests - it 'includes items for assignee dropdowns with non-ASCII characters in name' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('') - simulate_input('#note-body', "@#{user.name[0...8]}") + expect(find('#at-view-users')).to have_content(user.name) end - expect(page).to have_selector('.atwho-container') + it 'selects the first item for non-assignee dropdowns if a query is entered' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys(':1') + end - wait_for_requests + expect(page).to have_selector('.atwho-container') - expect(find('#at-view-users')).to have_content(user.name) - end + wait_for_requests - it 'selects the first item for non-assignee dropdowns if a query is entered' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys(':1') + expect(find('#at-view-58')).to have_selector('.cur:first-of-type') end - expect(page).to have_selector('.atwho-container') + context 'if a selected value has special characters' do + it 'wraps the result in double quotes' do + note = find('#note-body') + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('') + simulate_input('#note-body', "~#{label.title[0]}") + end - wait_for_requests + label_item = find('.atwho-view li', text: label.title) - expect(find('#at-view-58')).to have_selector('.cur:first-of-type') - end + expect_to_wrap(true, label_item, note, label.title) + end - context 'if a selected value has special characters' do - it 'wraps the result in double quotes' do - note = find('#note-body') - page.within '.timeline-content-form' do - find('#note-body').native.send_keys('') - simulate_input('#note-body', "~#{label.title[0]}") + it "shows dropdown after a new line" do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('test') + note.native.send_keys(:enter) + note.native.send_keys(:enter) + note.native.send_keys('@') + end + + expect(page).to have_selector('.atwho-container') end - label_item = find('.atwho-view li', text: label.title) + it "does not show dropdown when preceded with a special character" do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys("@") + end - expect_to_wrap(true, label_item, note, label.title) - end + expect(page).to have_selector('.atwho-container') - it "shows dropdown after a new line" do - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys('test') - note.native.send_keys(:enter) - note.native.send_keys(:enter) - note.native.send_keys('@') + page.within '.timeline-content-form' do + note.native.send_keys("@") + end + + expect(page).to have_selector('.atwho-container', visible: false) end - expect(page).to have_selector('.atwho-container') - end + it "does not throw an error if no labels exist" do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('~') + end - it "does not show dropdown when preceded with a special character" do - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys("@") + expect(page).to have_selector('.atwho-container', visible: false) end - expect(page).to have_selector('.atwho-container') + it 'doesn\'t wrap for assignee values' do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys("@#{user.username[0]}") + end - page.within '.timeline-content-form' do - note.native.send_keys("@") + user_item = find('.atwho-view li', text: user.username) + + expect_to_wrap(false, user_item, note, user.username) end - expect(page).to have_selector('.atwho-container', visible: false) - end + it 'doesn\'t wrap for emoji values' do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys(":cartwheel_") + end - it "does not throw an error if no labels exist" do - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys('~') + emoji_item = find('.atwho-view li', text: 'cartwheel_tone1') + + expect_to_wrap(false, emoji_item, note, 'cartwheel_tone1') end - expect(page).to have_selector('.atwho-container', visible: false) - end + it 'doesn\'t open autocomplete after non-word character' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys("@#{user.username[0..2]}!") + end - it 'doesn\'t wrap for assignee values' do - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys("@#{user.username[0]}") + expect(page).not_to have_selector('.atwho-view') + end + + it 'doesn\'t open autocomplete if there is no space before' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys("hello:#{user.username[0..2]}") + end + + expect(page).not_to have_selector('.atwho-view') end - user_item = find('.atwho-view li', text: user.username) + it 'triggers autocomplete after selecting a quick action' do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('/as') + end + + find('.atwho-view li', text: '/assign') + note.native.send_keys(:tab) - expect_to_wrap(false, user_item, note, user.username) + user_item = find('.atwho-view li', text: user.username) + expect(user_item).to have_content(user.username) + end end - it 'doesn\'t wrap for emoji values' do - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys(":cartwheel_") + context 'assignees' do + let(:issue_assignee) { create(:issue, project: project) } + let(:unassigned_user) { create(:user) } + + before do + issue_assignee.update(assignees: [user]) + + project.add_maintainer(unassigned_user) end - emoji_item = find('.atwho-view li', text: 'cartwheel_tone1') + it 'lists users who are currently not assigned to the issue when using /assign' do + visit project_issue_path(project, issue_assignee) - expect_to_wrap(false, emoji_item, note, 'cartwheel_tone1') - end + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('/as') + end - it 'doesn\'t open autocomplete after non-word character' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys("@#{user.username[0..2]}!") + find('.atwho-view li', text: '/assign') + note.native.send_keys(:tab) + + wait_for_requests + + expect(find('#at-view-users .atwho-view-ul')).not_to have_content(user.username) + expect(find('#at-view-users .atwho-view-ul')).to have_content(unassigned_user.username) end - expect(page).not_to have_selector('.atwho-view') + it 'shows dropdown on new issue form' do + visit new_project_issue_path(project) + + textarea = find('#issue_description') + textarea.native.send_keys('/ass') + find('.atwho-view li', text: '/assign') + textarea.native.send_keys(:tab) + + expect(find('#at-view-users .atwho-view-ul')).to have_content(unassigned_user.username) + expect(find('#at-view-users .atwho-view-ul')).to have_content(user.username) + end end - it 'doesn\'t open autocomplete if there is no space before' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys("hello:#{user.username[0..2]}") + context 'labels' do + it 'opens autocomplete menu for Labels when field starts with text with item escaping HTML characters' do + label_xss_title = 'alert label <img src=x onerror="alert(\'Hello xss\');" a' + create(:label, project: project, title: label_xss_title) + + note = find('#note-body') + + # It should show all the labels on "~". + type(note, '~') + + wait_for_requests + + page.within '.atwho-container #at-view-labels' do + expect(find('.atwho-view-ul').text).to have_content('alert label') + end end - expect(page).not_to have_selector('.atwho-view') - end + it 'allows colons when autocompleting scoped labels' do + create(:label, project: project, title: 'scoped:label') - it 'triggers autocomplete after selecting a quick action' do - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys('/as') + note = find('#note-body') + type(note, '~scoped:') + + wait_for_requests + + page.within '.atwho-container #at-view-labels' do + expect(find('.atwho-view-ul').text).to have_content('scoped:label') + end end - find('.atwho-view li', text: '/assign') - note.native.send_keys(:tab) + it 'allows colons when autocompleting scoped labels with double colons' do + create(:label, project: project, title: 'scoped::label') - user_item = find('.atwho-view li', text: user.username) - expect(user_item).to have_content(user.username) - end - end + note = find('#note-body') + type(note, '~scoped::') - context 'assignees' do - let(:issue_assignee) { create(:issue, project: project) } - let(:unassigned_user) { create(:user) } + wait_for_requests - before do - issue_assignee.update(assignees: [user]) + page.within '.atwho-container #at-view-labels' do + expect(find('.atwho-view-ul').text).to have_content('scoped::label') + end + end + + it 'allows spaces when autocompleting multi-word labels' do + create(:label, project: project, title: 'Accepting merge requests') - project.add_maintainer(unassigned_user) + note = find('#note-body') + type(note, '~Accepting merge') + + wait_for_requests + + page.within '.atwho-container #at-view-labels' do + expect(find('.atwho-view-ul').text).to have_content('Accepting merge requests') + end + end + + it 'only autocompletes the latest label' do + create(:label, project: project, title: 'Accepting merge requests') + create(:label, project: project, title: 'Accepting job applicants') + + note = find('#note-body') + type(note, '~Accepting merge requests foo bar ~Accepting job') + + wait_for_requests + + page.within '.atwho-container #at-view-labels' do + expect(find('.atwho-view-ul').text).to have_content('Accepting job applicants') + end + end + + it 'does not autocomplete labels if no tilde is typed' do + create(:label, project: project, title: 'Accepting merge requests') + + note = find('#note-body') + type(note, 'Accepting merge') + + wait_for_requests + + expect(page).not_to have_css('.atwho-container #at-view-labels') + end end - it 'lists users who are currently not assigned to the issue when using /assign' do - visit project_issue_path(project, issue_assignee) + shared_examples 'autocomplete suggestions' do + it 'suggests objects correctly' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys(object.class.reference_prefix) + end - note = find('#note-body') - page.within '.timeline-content-form' do - note.native.send_keys('/as') + page.within '.atwho-container' do + expect(page).to have_content(object.title) + + find('ul li').click + end + + expect(find('.new-note #note-body').value).to include(expected_body) end + end - find('.atwho-view li', text: '/assign') - note.native.send_keys(:tab) + context 'issues' do + let(:object) { issue } + let(:expected_body) { object.to_reference } - wait_for_requests + it_behaves_like 'autocomplete suggestions' + end + + context 'merge requests' do + let(:object) { create(:merge_request, source_project: project) } + let(:expected_body) { object.to_reference } - expect(find('#at-view-users .atwho-view-ul')).not_to have_content(user.username) - expect(find('#at-view-users .atwho-view-ul')).to have_content(unassigned_user.username) + it_behaves_like 'autocomplete suggestions' end - it 'shows dropdown on new issue form' do - visit new_project_issue_path(project) + context 'project snippets' do + let!(:object) { create(:project_snippet, project: project, title: 'code snippet') } + let(:expected_body) { object.to_reference } - textarea = find('#issue_description') - textarea.native.send_keys('/ass') - find('.atwho-view li', text: '/assign') - textarea.native.send_keys(:tab) + it_behaves_like 'autocomplete suggestions' + end + + context 'label' do + let!(:object) { label } + let(:expected_body) { object.title } + + it_behaves_like 'autocomplete suggestions' + end + + context 'milestone' do + let!(:object) { create(:milestone, project: project) } + let(:expected_body) { object.to_reference } - expect(find('#at-view-users .atwho-view-ul')).to have_content(unassigned_user.username) - expect(find('#at-view-users .atwho-view-ul')).to have_content(user.username) + it_behaves_like 'autocomplete suggestions' end end - context 'labels' do - it 'opens autocomplete menu for Labels when field starts with text with item escaping HTML characters' do - create(:label, project: project, title: label_xss_title) + describe 'when tribute_autocomplete feature flag is on' do + before do + stub_feature_flags(tribute_autocomplete: true) + + sign_in(user) + visit project_issue_path(project, issue) - note = find('#note-body') + wait_for_requests + end - # It should show all the labels on "~". - type(note, '~') + it 'updates issue description with GFM reference' do + find('.js-issuable-edit').click wait_for_requests - page.within '.atwho-container #at-view-labels' do - expect(find('.atwho-view-ul').text).to have_content('alert label') - end - end + simulate_input('#issue-description', "@#{user.name[0...3]}") + + wait_for_requests - it 'allows colons when autocompleting scoped labels' do - create(:label, project: project, title: 'scoped:label') + find('.tribute-container .highlight').click - note = find('#note-body') - type(note, '~scoped:') + click_button 'Save changes' wait_for_requests - page.within '.atwho-container #at-view-labels' do - expect(find('.atwho-view-ul').text).to have_content('scoped:label') - end + expect(find('.description')).to have_content(user.to_reference) end - it 'allows colons when autocompleting scoped labels with double colons' do - create(:label, project: project, title: 'scoped::label') + it 'opens autocomplete menu when field starts with text' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('@') + end - note = find('#note-body') - type(note, '~scoped::') + expect(page).to have_selector('.tribute-container') + end + + it 'opens autocomplete menu for Username when field starts with text with item escaping HTML characters' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('@ev') + end wait_for_requests - page.within '.atwho-container #at-view-labels' do - expect(find('.atwho-view-ul').text).to have_content('scoped::label') + expect(page).to have_selector('.tribute-container') + + page.within '.tribute-container ul' do + expect(find('li').text).to have_content(user_xss.username) end end - it 'allows spaces when autocompleting multi-word labels' do - create(:label, project: project, title: 'Accepting merge requests') + it 'doesnt open autocomplete menu character is prefixed with text' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('testing') + find('#note-body').native.send_keys('@') + end - note = find('#note-body') - type(note, '~Accepting merge') + expect(page).not_to have_selector('.tribute-container') + end + + it 'selects the first item for assignee dropdowns' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('@') + end + + expect(page).to have_selector('.tribute-container') wait_for_requests - page.within '.atwho-container #at-view-labels' do - expect(find('.atwho-view-ul').text).to have_content('Accepting merge requests') - end + expect(find('.tribute-container ul')).to have_selector('.highlight:first-of-type') end - it 'only autocompletes the latest label' do - create(:label, project: project, title: 'Accepting merge requests') - create(:label, project: project, title: 'Accepting job applicants') + it 'includes items for assignee dropdowns with non-ASCII characters in name' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys('') + simulate_input('#note-body', "@#{user.name[0...8]}") + end - note = find('#note-body') - type(note, '~Accepting merge requests foo bar ~Accepting job') + expect(page).to have_selector('.tribute-container') wait_for_requests - page.within '.atwho-container #at-view-labels' do - expect(find('.atwho-view-ul').text).to have_content('Accepting job applicants') - end + expect(find('.tribute-container')).to have_content(user.name) end - it 'does not autocomplete labels if no tilde is typed' do - create(:label, project: project, title: 'Accepting merge requests') + context 'if a selected value has special characters' do + it "shows dropdown after a new line" do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('test') + note.native.send_keys(:enter) + note.native.send_keys(:enter) + note.native.send_keys('@') + end - note = find('#note-body') - type(note, 'Accepting merge') + expect(page).to have_selector('.tribute-container') + end - wait_for_requests + it "does not show dropdown when preceded with a special character" do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys("@") + end - expect(page).not_to have_css('.atwho-container #at-view-labels') - end - end + expect(page).to have_selector('.tribute-container') - shared_examples 'autocomplete suggestions' do - it 'suggests objects correctly' do - page.within '.timeline-content-form' do - find('#note-body').native.send_keys(object.class.reference_prefix) + page.within '.timeline-content-form' do + note.native.send_keys("@") + end + + expect(page).to have_selector('.tribute-container', visible: false) end - page.within '.atwho-container' do - expect(page).to have_content(object.title) + it 'doesn\'t wrap for assignee values' do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys("@#{user.username[0]}") + end - find('ul li').click + user_item = find('.tribute-container li', text: user.username) + + expect_to_wrap(false, user_item, note, user.username) end - expect(find('.new-note #note-body').value).to include(expected_body) - end - end + it 'doesn\'t open autocomplete after non-word character' do + page.within '.timeline-content-form' do + find('#note-body').native.send_keys("@#{user.username[0..2]}!") + end - context 'issues' do - let(:object) { issue } - let(:expected_body) { object.to_reference } + expect(page).not_to have_selector('.tribute-container') + end - it_behaves_like 'autocomplete suggestions' - end + it 'triggers autocomplete after selecting a quick action' do + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('/as') + end - context 'merge requests' do - let(:object) { create(:merge_request, source_project: project) } - let(:expected_body) { object.to_reference } + find('.atwho-view li', text: '/assign') + note.native.send_keys(:tab) + note.native.send_keys(:right) - it_behaves_like 'autocomplete suggestions' - end + wait_for_requests - context 'project snippets' do - let!(:object) { create(:project_snippet, project: project, title: 'code snippet') } - let(:expected_body) { object.to_reference } + user_item = find('.tribute-container li', text: user.username) + expect(user_item).to have_content(user.username) + end + end - it_behaves_like 'autocomplete suggestions' - end + context 'assignees' do + let(:issue_assignee) { create(:issue, project: project) } + let(:unassigned_user) { create(:user) } - context 'label' do - let!(:object) { label } - let(:expected_body) { object.title } + before do + issue_assignee.update(assignees: [user]) - it_behaves_like 'autocomplete suggestions' - end + project.add_maintainer(unassigned_user) + end + + it 'lists users who are currently not assigned to the issue when using /assign' do + visit project_issue_path(project, issue_assignee) + + note = find('#note-body') + page.within '.timeline-content-form' do + note.native.send_keys('/as') + end - context 'milestone' do - let!(:object) { create(:milestone, project: project) } - let(:expected_body) { object.to_reference } + find('.atwho-view li', text: '/assign') + note.native.send_keys(:tab) + note.native.send_keys(:right) - it_behaves_like 'autocomplete suggestions' + wait_for_requests + + expect(find('.tribute-container ul')).not_to have_content(user.username) + expect(find('.tribute-container ul')).to have_content(unassigned_user.username) + end + end end private diff --git a/spec/features/issues/issue_detail_spec.rb b/spec/features/issues/issue_detail_spec.rb index ab319daec71..9879703c8bf 100644 --- a/spec/features/issues/issue_detail_spec.rb +++ b/spec/features/issues/issue_detail_spec.rb @@ -28,7 +28,7 @@ RSpec.describe 'Issue Detail', :js do visit project_issue_path(project, issue) end - it 'encodes the description to prevent xss issues', quarantine: 'https://gitlab.com/gitlab-org/gitlab/issues/207951' do + it 'encodes the description to prevent xss issues', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/207951' do page.within('.issuable-details .detail-page-description') do image = find('img.js-lazy-loaded') diff --git a/spec/features/issues/issue_sidebar_spec.rb b/spec/features/issues/issue_sidebar_spec.rb index 9e4362bf0e5..ecda80f2483 100644 --- a/spec/features/issues/issue_sidebar_spec.rb +++ b/spec/features/issues/issue_sidebar_spec.rb @@ -195,7 +195,7 @@ RSpec.describe 'Issue Sidebar' do end end - context 'creating a project label', :js, :quarantine do + context 'creating a project label', :js, quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27992' do before do page.within('.block.labels') do click_link 'Create project' diff --git a/spec/features/issues/move_spec.rb b/spec/features/issues/move_spec.rb index f3a6655f397..ee2fbf0865e 100644 --- a/spec/features/issues/move_spec.rb +++ b/spec/features/issues/move_spec.rb @@ -97,6 +97,45 @@ RSpec.describe 'issue move to another project' do end end + context 'service desk issue moved to a project with service desk disabled', :js do + let(:project_title) { 'service desk disabled project' } + let(:warning_selector) { '.js-alert-moved-from-service-desk-warning' } + let(:namespace) { create(:namespace) } + let(:regular_project) { create(:project, title: project_title, service_desk_enabled: false) } + let(:service_desk_project) { build(:project, :private, namespace: namespace, service_desk_enabled: true) } + let(:service_desk_issue) { create(:issue, project: service_desk_project, author: ::User.support_bot) } + + before do + allow(Gitlab).to receive(:com?).and_return(true) + allow(Gitlab::IncomingEmail).to receive(:enabled?).and_return(true) + allow(Gitlab::IncomingEmail).to receive(:supports_wildcard?).and_return(true) + + regular_project.add_reporter(user) + service_desk_project.add_reporter(user) + + visit issue_path(service_desk_issue) + + find('.js-move-issue').click + wait_for_requests + find('.js-move-issue-dropdown-item', text: project_title).click + find('.js-move-issue-confirmation-button').click + end + + it 'shows an alert after being moved' do + expect(page).to have_content('This project does not have Service Desk enabled') + end + + it 'does not show an alert after being dismissed' do + find("#{warning_selector} .js-close").click + + expect(page).to have_no_selector(warning_selector) + + page.refresh + + expect(page).to have_no_selector(warning_selector) + end + end + def issue_path(issue) project_issue_path(issue.project, issue) end diff --git a/spec/features/issues/service_desk_spec.rb b/spec/features/issues/service_desk_spec.rb new file mode 100644 index 00000000000..0995aa11654 --- /dev/null +++ b/spec/features/issues/service_desk_spec.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe 'Service Desk Issue Tracker', :js do + let(:project) { create(:project, :private, service_desk_enabled: true) } + let(:user) { create(:user) } + + before do + stub_feature_flags(vue_issuables_list: false) + + allow(Gitlab::IncomingEmail).to receive(:enabled?).and_return(true) + allow(Gitlab::IncomingEmail).to receive(:supports_wildcard?).and_return(true) + + project.add_maintainer(user) + sign_in(user) + end + + describe 'navigation to service desk' do + before do + visit project_path(project) + find('.sidebar-top-level-items .shortcuts-issues').click + find('.sidebar-sub-level-items a[title="Service Desk"]').click + end + + it 'can navigate to the service desk from link in the sidebar' do + expect(page).to have_content('Use Service Desk to connect with your users') + end + end + + describe 'issues list' do + context 'when service desk is misconfigured' do + before do + allow(Gitlab::ServiceDesk).to receive(:supported?).and_return(false) + visit service_desk_project_issues_path(project) + end + + it 'shows a message to say the configuration is incomplete' do + expect(page).to have_css('.empty-state') + expect(page).to have_text('Service Desk is enabled but not yet active') + expect(page).to have_text('You must set up incoming email before it becomes active') + expect(page).to have_link('More information', href: help_page_path('administration/incoming_email', anchor: 'set-it-up')) + end + end + + context 'when service desk has not been activated' do + let(:project_without_service_desk) { create(:project, :private, service_desk_enabled: false) } + + describe 'service desk info content' do + context 'when user has permissions to edit project settings' do + before do + project_without_service_desk.add_maintainer(user) + visit service_desk_project_issues_path(project_without_service_desk) + end + + it 'displays the large info box, documentation, and a button to configure' do + aggregate_failures do + expect(page).to have_css('.empty-state') + expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk')) + expect(page).to have_link('Turn on Service Desk') + end + end + end + + context 'when user does not have permission to edit project settings' do + before do + project_without_service_desk.add_guest(user) + visit service_desk_project_issues_path(project_without_service_desk) + end + + it 'does not show a button configure service desk' do + expect(page).not_to have_link('Turn on Service Desk') + end + end + end + end + + context 'when service desk has been activated' do + context 'when there are no issues' do + describe 'service desk info content' do + before do + visit service_desk_project_issues_path(project) + end + + it 'displays the large info box, documentation, and the address' do + aggregate_failures do + expect(page).to have_css('.empty-state') + expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk')) + expect(page).not_to have_link('Turn on 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_link('Read more', href: help_page_path('user/project/service_desk')) + expect(page).not_to have_link('Turn on Service Desk') + expect(page).not_to have_content(project.service_desk_address) + end + end + end + end + end + + context 'when there are issues' do + let(:support_bot) { User.support_bot } + let(:other_user) { create(:user) } + let!(:service_desk_issue) { create(:issue, project: project, author: support_bot) } + let!(:other_user_issue) { create(:issue, project: project, author: other_user) } + + describe 'service desk info content' do + before do + visit service_desk_project_issues_path(project) + end + + it 'displays the small info box, documentation, a button to configure service desk, and the address' do + aggregate_failures do + expect(page).to have_css('.non-empty-state') + expect(page).to have_link('Read more', href: help_page_path('user/project/service_desk')) + expect(page).not_to have_link('Turn on Service Desk') + expect(page).to have_content(project.service_desk_address) + end + end + end + + describe 'issues list' do + before do + visit service_desk_project_issues_path(project) + end + + it 'only displays issues created by support bot' do + expect(page).to have_selector('.issues-list .issue', count: 1) + end + end + + describe 'search box' do + before do + visit service_desk_project_issues_path(project) + end + + it 'adds hidden support bot author token' do + expect(page).to have_selector('.filtered-search-token .value', text: 'Support Bot', visible: false) + end + + it 'support bot author token cannot be deleted' do + find('.input-token .filtered-search').native.send_key(:backspace) + expect(page).to have_selector('.js-visual-token', count: 1) + end + end + end + end + end +end diff --git a/spec/features/issues/update_issues_spec.rb b/spec/features/issues/update_issues_spec.rb index f8385f183d2..dfe3a1bf1b3 100644 --- a/spec/features/issues/update_issues_spec.rb +++ b/spec/features/issues/update_issues_spec.rb @@ -8,6 +8,7 @@ RSpec.describe 'Multiple issue updating from issues#index', :js do let!(:user) { create(:user)} before do + stub_feature_flags(vue_issuables_list: false) project.add_maintainer(user) sign_in(user) 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 a546fb3e85b..617eac88973 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 @@ -31,7 +31,7 @@ RSpec.describe 'User creates branch and merge request on issue page', :js do end # In order to improve tests performance, all UI checks are placed in this test. - it 'shows elements', :quarantine do + it 'shows elements', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27993' do button_create_merge_request = find('.js-create-merge-request') button_toggle_dropdown = find('.create-mr-dropdown-wrap .dropdown-toggle') @@ -71,7 +71,7 @@ RSpec.describe 'User creates branch and merge request on issue page', :js do perform_enqueued_jobs do select_dropdown_option('create-mr') - expect(page).to have_content('WIP: Resolve "Cherry-Coloured Funk"') + expect(page).to have_content('Draft: Resolve "Cherry-Coloured Funk"') expect(current_path).to eq(project_merge_request_path(project, MergeRequest.first)) wait_for_requests @@ -100,7 +100,7 @@ RSpec.describe 'User creates branch and merge request on issue page', :js do perform_enqueued_jobs do select_dropdown_option('create-mr', branch_name) - expect(page).to have_content('WIP: Resolve "Cherry-Coloured Funk"') + expect(page).to have_content('Draft: Resolve "Cherry-Coloured Funk"') expect(page).to have_content('Request to merge custom-branch-name into') expect(current_path).to eq(project_merge_request_path(project, MergeRequest.first)) @@ -141,7 +141,7 @@ RSpec.describe 'User creates branch and merge request on issue page', :js do visit project_issue_path(project, issue) end - it 'disables the create branch button', :quarantine do + it 'disables the create branch button', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27985' do expect(page).to have_css('.create-mr-dropdown-wrap .unavailable:not(.hidden)') expect(page).to have_css('.create-mr-dropdown-wrap .available.hidden', visible: false) expect(page).to have_content /Related merge requests/ diff --git a/spec/features/issues/user_filters_issues_spec.rb b/spec/features/issues/user_filters_issues_spec.rb index 20ad47b111a..54a600910ef 100644 --- a/spec/features/issues/user_filters_issues_spec.rb +++ b/spec/features/issues/user_filters_issues_spec.rb @@ -7,6 +7,8 @@ RSpec.describe 'User filters issues' do let_it_be(:project) { create(:project_empty_repo, :public) } before do + stub_feature_flags(vue_issuables_list: false) + %w[foobar barbaz].each do |title| create(:issue, author: user, diff --git a/spec/features/issues/user_interacts_with_awards_spec.rb b/spec/features/issues/user_interacts_with_awards_spec.rb index 7b7e087a6d6..35d9db68d32 100644 --- a/spec/features/issues/user_interacts_with_awards_spec.rb +++ b/spec/features/issues/user_interacts_with_awards_spec.rb @@ -16,7 +16,7 @@ RSpec.describe 'User interacts with awards' do visit(project_issue_path(project, issue)) end - it 'toggles the thumbsup award emoji', :quarantine do + it 'toggles the thumbsup award emoji', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27959' do page.within('.awards') do thumbsup = page.first('.award-control') thumbsup.click @@ -77,7 +77,7 @@ RSpec.describe 'User interacts with awards' do end end - it 'shows the list of award emoji categories', :quarantine do + it 'shows the list of award emoji categories', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27991' do page.within('.awards') do page.find('.js-add-award').click end diff --git a/spec/features/issues/user_sees_breadcrumb_links_spec.rb b/spec/features/issues/user_sees_breadcrumb_links_spec.rb index 2660101c330..f5793758a9b 100644 --- a/spec/features/issues/user_sees_breadcrumb_links_spec.rb +++ b/spec/features/issues/user_sees_breadcrumb_links_spec.rb @@ -7,6 +7,8 @@ RSpec.describe 'New issue breadcrumb' do let(:user) { project.creator } before do + stub_feature_flags(vue_issuables_list: false) + sign_in(user) visit(new_project_issue_path(project)) end diff --git a/spec/features/issues/user_sees_empty_state_spec.rb b/spec/features/issues/user_sees_empty_state_spec.rb index 047c5ca2189..e39369b0150 100644 --- a/spec/features/issues/user_sees_empty_state_spec.rb +++ b/spec/features/issues/user_sees_empty_state_spec.rb @@ -6,6 +6,10 @@ RSpec.describe 'Issues > User sees empty state' do let_it_be(:project) { create(:project, :public) } let_it_be(:user) { project.creator } + before do + stub_feature_flags(vue_issuables_list: false) + end + shared_examples_for 'empty state with filters' do it 'user sees empty state with filters' do create(:issue, author: user, project: project) diff --git a/spec/features/issues/user_sorts_issues_spec.rb b/spec/features/issues/user_sorts_issues_spec.rb index ec38bf99035..91c6419b464 100644 --- a/spec/features/issues/user_sorts_issues_spec.rb +++ b/spec/features/issues/user_sorts_issues_spec.rb @@ -16,6 +16,8 @@ RSpec.describe "User sorts issues" do let_it_be(:later_due_milestone) { create(:milestone, project: project, due_date: '2013-12-12') } before do + stub_feature_flags(vue_issuables_list: false) + create_list(:award_emoji, 2, :upvote, awardable: issue1) create_list(:award_emoji, 2, :downvote, awardable: issue2) create(:award_emoji, :downvote, awardable: issue1) diff --git a/spec/features/issues/user_views_issues_spec.rb b/spec/features/issues/user_views_issues_spec.rb index 91de813e414..34cea7f3b0b 100644 --- a/spec/features/issues/user_views_issues_spec.rb +++ b/spec/features/issues/user_views_issues_spec.rb @@ -6,9 +6,14 @@ RSpec.describe "User views issues" do let!(:closed_issue) { create(:closed_issue, project: project) } let!(:open_issue1) { create(:issue, project: project) } let!(:open_issue2) { create(:issue, project: project) } + let!(:moved_open_issue) { create(:issue, project: project, moved_to: create(:issue)) } let_it_be(:user) { create(:user) } + before do + stub_feature_flags(vue_issuables_list: false) + end + shared_examples "opens issue from list" do it "opens issue" do click_link(issue.title) @@ -32,6 +37,7 @@ RSpec.describe "User views issues" do .and have_content(open_issue1.title) .and have_content(open_issue2.title) .and have_no_content(closed_issue.title) + .and have_content(moved_open_issue.title) .and have_no_selector(".js-new-board-list") end @@ -62,6 +68,7 @@ RSpec.describe "User views issues" do .and have_content(closed_issue.title) .and have_no_content(open_issue1.title) .and have_no_content(open_issue2.title) + .and have_no_content(moved_open_issue.title) .and have_no_selector(".js-new-board-list") end @@ -82,6 +89,8 @@ RSpec.describe "User views issues" do .and have_content(closed_issue.title) .and have_content(open_issue1.title) .and have_content(open_issue2.title) + .and have_content(moved_open_issue.title) + .and have_no_content('CLOSED (MOVED)') .and have_no_selector(".js-new-board-list") end @@ -116,4 +125,24 @@ RSpec.describe "User views issues" do context "when not signed in" do include_examples "public project" end + + context 'when vue_issuables_list feature is enabled', :js do + before do + stub_feature_flags(vue_issuables_list: true) + end + + context 'when signed in' do + before do + project.add_developer(user) + sign_in(user) + end + + include_examples "public project" + include_examples "internal project" + end + + context 'when not signed in' do + include_examples "public project" + end + end end |