diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-28 15:08:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-09-28 15:08:02 +0300 |
commit | 5573dc288d880386a96afc9458f7d1abd6cd745f (patch) | |
tree | fb3ec81501f337b71b10e35285e56654c9c9ab52 /spec | |
parent | 1e16ecd8e2fd4b23ee56519072d245d261ea2804 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
52 files changed, 26 insertions, 286 deletions
diff --git a/spec/features/discussion_comments/issue_spec.rb b/spec/features/discussion_comments/issue_spec.rb index b270a4c7600..90be3f0760d 100644 --- a/spec/features/discussion_comments/issue_spec.rb +++ b/spec/features/discussion_comments/issue_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Thread Comments Issue', :js, feature_category: :source_code_management do - include ContentEditorHelpers - let(:user) { create(:user) } let(:project) { create(:project) } let(:issue) { create(:issue, project: project) } @@ -14,7 +12,6 @@ RSpec.describe 'Thread Comments Issue', :js, feature_category: :source_code_mana sign_in(user) visit project_issue_path(project, issue) - close_rich_text_promo_popover_if_present end it_behaves_like 'thread comments for issue, epic and merge request', 'issue' diff --git a/spec/features/groups/milestone_spec.rb b/spec/features/groups/milestone_spec.rb index d870471d646..bb7cc3db452 100644 --- a/spec/features/groups/milestone_spec.rb +++ b/spec/features/groups/milestone_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Group milestones', feature_category: :groups_and_projects do - include ContentEditorHelpers - let_it_be(:group) { create(:group) } let_it_be(:project) { create(:project_empty_repo, group: group) } let_it_be(:user) { create(:group_member, :maintainer, user: create(:user), group: group).user } @@ -20,7 +18,6 @@ RSpec.describe 'Group milestones', feature_category: :groups_and_projects do context 'create a milestone', :js do before do visit new_group_milestone_path(group) - close_rich_text_promo_popover_if_present end it 'renders description preview' do @@ -69,7 +66,6 @@ RSpec.describe 'Group milestones', feature_category: :groups_and_projects do context 'when no milestones' do it 'renders no milestones text' do visit group_milestones_path(group) - close_rich_text_promo_popover_if_present expect(page).to have_content('Use milestones to track issues and merge requests') end end @@ -99,7 +95,6 @@ RSpec.describe 'Group milestones', feature_category: :groups_and_projects do before do visit group_milestones_path(group) - close_rich_text_promo_popover_if_present end it 'counts milestones correctly' do @@ -175,7 +170,6 @@ RSpec.describe 'Group milestones', feature_category: :groups_and_projects do before do visit group_milestone_path(group, milestone) - close_rich_text_promo_popover_if_present end it 'renders the issues tab' do diff --git a/spec/features/issuables/markdown_references/jira_spec.rb b/spec/features/issuables/markdown_references/jira_spec.rb index e072231c6e9..887bc7d0c87 100644 --- a/spec/features/issuables/markdown_references/jira_spec.rb +++ b/spec/features/issuables/markdown_references/jira_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe "Jira", :js, feature_category: :team_planning do - include ContentEditorHelpers - let(:user) { create(:user) } let(:actual_project) { create(:project, :public, :repository) } let(:merge_request) { create(:merge_request, target_project: actual_project, source_project: actual_project) } @@ -26,7 +24,6 @@ RSpec.describe "Jira", :js, feature_category: :team_planning do sign_in(user) visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present build_note end diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb index 6e3a5ecaac7..bdcc2da1a10 100644 --- a/spec/features/issues/form_spec.rb +++ b/spec/features/issues/form_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do include ActionView::Helpers::JavaScriptHelper include ListboxHelpers - include ContentEditorHelpers let_it_be(:project) { create(:project, :repository) } let_it_be(:user) { create(:user, :no_super_sidebar) } @@ -34,7 +33,6 @@ RSpec.describe 'New/edit issue', :js, feature_category: :team_planning do describe 'new issue' do before do visit new_project_issue_path(project) - close_rich_text_promo_popover_if_present end describe 'shorten users API pagination limit' do diff --git a/spec/features/issues/gfm_autocomplete_spec.rb b/spec/features/issues/gfm_autocomplete_spec.rb index 47e9575da54..a1f2275df6e 100644 --- a/spec/features/issues/gfm_autocomplete_spec.rb +++ b/spec/features/issues/gfm_autocomplete_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe 'GFM autocomplete', :js, feature_category: :team_planning do include CookieHelper include Features::AutocompleteHelpers - include ContentEditorHelpers let_it_be(:user) { create(:user, name: '💃speciąl someone💃', username: 'someone.special') } let_it_be(:user2) { create(:user, name: 'Marge Simpson', username: 'msimpson') } @@ -33,7 +32,6 @@ RSpec.describe 'GFM autocomplete', :js, feature_category: :team_planning do before do sign_in(user) visit new_project_issue_path(project) - close_rich_text_promo_popover_if_present wait_for_requests end @@ -52,7 +50,6 @@ RSpec.describe 'GFM autocomplete', :js, feature_category: :team_planning do sign_in(user) set_cookie('new-actions-popover-viewed', 'true') visit project_issue_path(project, issue_to_edit) - close_rich_text_promo_popover_if_present wait_for_requests end @@ -88,7 +85,6 @@ RSpec.describe 'GFM autocomplete', :js, feature_category: :team_planning do before do sign_in(user) visit project_issue_path(project, issue) - close_rich_text_promo_popover_if_present wait_for_requests end diff --git a/spec/features/issues/markdown_toolbar_spec.rb b/spec/features/issues/markdown_toolbar_spec.rb index b7a0949edce..484d160057c 100644 --- a/spec/features/issues/markdown_toolbar_spec.rb +++ b/spec/features/issues/markdown_toolbar_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Issue markdown toolbar', :js, feature_category: :team_planning do - include ContentEditorHelpers - let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } let_it_be(:user) { create(:user) } @@ -13,7 +11,6 @@ RSpec.describe 'Issue markdown toolbar', :js, feature_category: :team_planning d sign_in(user) visit project_issue_path(project, issue) - close_rich_text_promo_popover_if_present end it "doesn't include first new line when adding bold" do diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb index 293b6c53eb5..054635d61b1 100644 --- a/spec/features/issues/note_polling_spec.rb +++ b/spec/features/issues/note_polling_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe 'Issue notes polling', :js, feature_category: :team_planning do include NoteInteractionHelpers - include ContentEditorHelpers let(:project) { create(:project, :public) } let(:issue) { create(:issue, project: project) } @@ -12,7 +11,6 @@ RSpec.describe 'Issue notes polling', :js, feature_category: :team_planning do describe 'creates' do 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 @@ -31,7 +29,6 @@ RSpec.describe 'Issue notes polling', :js, feature_category: :team_planning do before do sign_in(user) visit project_issue_path(project, issue) - close_rich_text_promo_popover_if_present end it 'displays the updated content' do diff --git a/spec/features/issues/notes_on_issues_spec.rb b/spec/features/issues/notes_on_issues_spec.rb index 62855c7467f..8d6262efa53 100644 --- a/spec/features/issues/notes_on_issues_spec.rb +++ b/spec/features/issues/notes_on_issues_spec.rb @@ -3,12 +3,9 @@ require 'spec_helper' RSpec.describe 'Create notes on issues', :js, feature_category: :team_planning do - include ContentEditorHelpers - let(:user) { create(:user) } def submit_comment(text) - close_rich_text_promo_popover_if_present fill_in 'note[note]', with: text click_button 'Comment' wait_for_requests diff --git a/spec/features/issues/user_comments_on_issue_spec.rb b/spec/features/issues/user_comments_on_issue_spec.rb index f18992325d8..d954a1d15ff 100644 --- a/spec/features/issues/user_comments_on_issue_spec.rb +++ b/spec/features/issues/user_comments_on_issue_spec.rb @@ -5,7 +5,6 @@ require "spec_helper" RSpec.describe "User comments on issue", :js, feature_category: :team_planning do include Features::AutocompleteHelpers include Features::NotesHelpers - include ContentEditorHelpers let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } @@ -16,7 +15,6 @@ RSpec.describe "User comments on issue", :js, feature_category: :team_planning d sign_in(user) visit(project_issue_path(project, issue)) - close_rich_text_promo_popover_if_present end context "when adding comments" do diff --git a/spec/features/issues/user_creates_issue_spec.rb b/spec/features/issues/user_creates_issue_spec.rb index c4aff4ca04b..5fadeb893d0 100644 --- a/spec/features/issues/user_creates_issue_spec.rb +++ b/spec/features/issues/user_creates_issue_spec.rb @@ -4,7 +4,6 @@ require "spec_helper" RSpec.describe "User creates issue", feature_category: :team_planning do include DropzoneHelper - include ContentEditorHelpers let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:user) { create(:user) } @@ -39,7 +38,6 @@ RSpec.describe "User creates issue", feature_category: :team_planning do sign_in(user) visit(new_project_issue_path(project)) - close_rich_text_promo_popover_if_present end context 'available metadata' do diff --git a/spec/features/issues/user_edits_issue_spec.rb b/spec/features/issues/user_edits_issue_spec.rb index 45d95db8ff1..7e513d8f5c7 100644 --- a/spec/features/issues/user_edits_issue_spec.rb +++ b/spec/features/issues/user_edits_issue_spec.rb @@ -4,7 +4,6 @@ require "spec_helper" RSpec.describe "Issues > User edits issue", :js, feature_category: :team_planning do include CookieHelper - include ContentEditorHelpers let_it_be(:project) { create(:project_empty_repo, :public) } let_it_be(:project_with_milestones) { create(:project_empty_repo, :public) } @@ -28,7 +27,6 @@ RSpec.describe "Issues > User edits issue", :js, feature_category: :team_plannin before do stub_licensed_features(multiple_issue_assignees: false) visit edit_project_issue_path(project, issue) - close_rich_text_promo_popover_if_present end it_behaves_like 'edits content using the content editor' diff --git a/spec/features/issues/user_interacts_with_awards_spec.rb b/spec/features/issues/user_interacts_with_awards_spec.rb index e1099ba242e..539e429534e 100644 --- a/spec/features/issues/user_interacts_with_awards_spec.rb +++ b/spec/features/issues/user_interacts_with_awards_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe 'User interacts with awards', feature_category: :team_planning do include MobileHelpers - include ContentEditorHelpers let(:user) { create(:user) } @@ -17,7 +16,6 @@ RSpec.describe 'User interacts with awards', feature_category: :team_planning do sign_in(user) visit(project_issue_path(project, issue)) - close_rich_text_promo_popover_if_present end it 'toggles the thumbsup award emoji', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/27959' do diff --git a/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb b/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb index ef448c06a3f..91b18454af5 100644 --- a/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb +++ b/spec/features/issues/user_sees_sidebar_updates_in_realtime_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Issues > Real-time sidebar', :js, :with_license, feature_category: :team_planning do - include ContentEditorHelpers - let_it_be(:project) { create(:project, :public) } let_it_be(:issue) { create(:issue, project: project) } let_it_be(:user) { create(:user) } @@ -22,7 +20,6 @@ RSpec.describe 'Issues > Real-time sidebar', :js, :with_license, feature_categor using_session :other_session do visit project_issue_path(project, issue) - close_rich_text_promo_popover_if_present expect(page.find('.assignee')).to have_content 'None' end @@ -46,7 +43,6 @@ RSpec.describe 'Issues > Real-time sidebar', :js, :with_license, feature_categor using_session :other_session do visit project_issue_path(project, issue) wait_for_requests - close_rich_text_promo_popover_if_present expect(labels_value).to have_content('None') end @@ -54,7 +50,6 @@ RSpec.describe 'Issues > Real-time sidebar', :js, :with_license, feature_categor visit project_issue_path(project, issue) wait_for_requests - close_rich_text_promo_popover_if_present expect(labels_value).to have_content('None') page.within(labels_widget) do diff --git a/spec/features/issues/user_uses_quick_actions_spec.rb b/spec/features/issues/user_uses_quick_actions_spec.rb index c15716243ae..d3552b87fea 100644 --- a/spec/features/issues/user_uses_quick_actions_spec.rb +++ b/spec/features/issues/user_uses_quick_actions_spec.rb @@ -9,7 +9,6 @@ require 'spec_helper' # for each existing quick action unless they test something not tested by existing tests. RSpec.describe 'Issues > User uses quick actions', :js, feature_category: :team_planning do include Features::NotesHelpers - include ContentEditorHelpers context "issuable common quick actions" do let(:new_url_opts) { {} } @@ -35,7 +34,6 @@ RSpec.describe 'Issues > User uses quick actions', :js, feature_category: :team_ sign_in(user) visit project_issue_path(project, issue) wait_for_all_requests - close_rich_text_promo_popover_if_present end after do diff --git a/spec/features/labels_hierarchy_spec.rb b/spec/features/labels_hierarchy_spec.rb index edc7b570933..72f5b46c3ad 100644 --- a/spec/features/labels_hierarchy_spec.rb +++ b/spec/features/labels_hierarchy_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe 'Labels Hierarchy', :js, feature_category: :team_planning do include FilteredSearchHelpers - include ContentEditorHelpers let!(:user) { create(:user, :no_super_sidebar) } let!(:grandparent) { create(:group) } @@ -161,7 +160,6 @@ RSpec.describe 'Labels Hierarchy', :js, feature_category: :team_planning do context 'when creating new issuable' do before do visit new_project_issue_path(project_1) - close_rich_text_promo_popover_if_present end it 'is able to assign ancestor group labels' do @@ -198,7 +196,6 @@ RSpec.describe 'Labels Hierarchy', :js, feature_category: :team_planning do project_1.add_developer(user) visit project_issue_path(project_1, issue) - close_rich_text_promo_popover_if_present end it_behaves_like 'assigning labels from sidebar' diff --git a/spec/features/merge_request/user_accepts_merge_request_spec.rb b/spec/features/merge_request/user_accepts_merge_request_spec.rb index 38291573256..e3989a8a192 100644 --- a/spec/features/merge_request/user_accepts_merge_request_spec.rb +++ b/spec/features/merge_request/user_accepts_merge_request_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inline, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:merge_request) { create(:merge_request, :simple, source_project: project) } let(:project) { create(:project, :public, :repository) } let(:user) { create(:user) } @@ -17,7 +15,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli context 'presents merged merge request content' do it 'when merge method is set to merge commit' do visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present click_merge_button @@ -33,7 +30,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli merge_request = create(:merge_request, :rebased, source_project: project) visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present click_merge_button @@ -44,7 +40,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli merge_request = create(:merge_request, :rebased, source_project: project, squash: true) visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present click_merge_button @@ -56,7 +51,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli context 'with removing the source branch' do before do visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present end it 'accepts a merge request' do @@ -75,7 +69,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli context 'without removing the source branch' do before do visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present end it 'accepts a merge request' do @@ -93,7 +86,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli context 'when a URL has an anchor' do before do visit(merge_request_path(merge_request, anchor: 'note_123')) - close_rich_text_promo_popover_if_present end it 'accepts a merge request' do @@ -114,7 +106,6 @@ RSpec.describe 'User accepts a merge request', :js, :sidekiq_might_not_need_inli merge_request.mark_as_mergeable visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present end it 'accepts a merge request' do diff --git a/spec/features/merge_request/user_comments_on_diff_spec.rb b/spec/features/merge_request/user_comments_on_diff_spec.rb index 215fe1f7521..9135f5c7b98 100644 --- a/spec/features/merge_request/user_comments_on_diff_spec.rb +++ b/spec/features/merge_request/user_comments_on_diff_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe 'User comments on a diff', :js, feature_category: :code_review_workflow do include MergeRequestDiffHelpers include RepoHelpers - include ContentEditorHelpers let(:project) { create(:project, :repository) } let(:merge_request) do @@ -140,7 +139,6 @@ RSpec.describe 'User comments on a diff', :js, feature_category: :code_review_wo end visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present page.within('.notes .discussion') do find('.js-vue-discussion-reply').click diff --git a/spec/features/merge_request/user_edits_merge_request_spec.rb b/spec/features/merge_request/user_edits_merge_request_spec.rb index b1cff72c374..584a17ae33d 100644 --- a/spec/features/merge_request/user_edits_merge_request_spec.rb +++ b/spec/features/merge_request/user_edits_merge_request_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'User edits a merge request', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:project) { create(:project, :repository) } let(:merge_request) { create(:merge_request, source_project: project, target_project: project) } let(:user) { create(:user) } @@ -87,8 +85,6 @@ RSpec.describe 'User edits a merge request', :js, feature_category: :code_review describe 'changing target branch' do it 'allows user to change target branch' do - close_rich_text_promo_popover_if_present - expect(page).to have_content('From master into feature') first('.js-target-branch').click diff --git a/spec/features/merge_request/user_merges_immediately_spec.rb b/spec/features/merge_request/user_merges_immediately_spec.rb index 5fe9947d0df..71af2045bab 100644 --- a/spec/features/merge_request/user_merges_immediately_spec.rb +++ b/spec/features/merge_request/user_merges_immediately_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Merge requests > User merges immediately', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let!(:merge_request) do @@ -33,7 +31,6 @@ RSpec.describe 'Merge requests > User merges immediately', :js, feature_category project.add_maintainer(user) sign_in(user) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end it 'enables merge immediately' do diff --git a/spec/features/merge_request/user_merges_merge_request_spec.rb b/spec/features/merge_request/user_merges_merge_request_spec.rb index aee42784d05..ede686cc700 100644 --- a/spec/features/merge_request/user_merges_merge_request_spec.rb +++ b/spec/features/merge_request/user_merges_merge_request_spec.rb @@ -3,8 +3,6 @@ require "spec_helper" RSpec.describe "User merges a merge request", :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let_it_be(:user) { create(:user, :no_super_sidebar) } before do @@ -31,7 +29,6 @@ RSpec.describe "User merges a merge request", :js, feature_category: :code_revie create(:merge_request, source_project: project, source_branch: 'branch-1') visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present expect(page).to have_css('.js-merge-counter', text: '2') diff --git a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb index 62404077cea..78814e36cfe 100644 --- a/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb +++ b/spec/features/merge_request/user_merges_only_if_pipeline_succeeds_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:merge_request) { create(:merge_request_with_diffs) } let(:project) { merge_request.target_project } @@ -116,7 +114,6 @@ RSpec.describe 'Merge request > User merges only if pipeline succeeds', :js, fea it 'allows MR to be merged immediately' do visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present wait_for_requests diff --git a/spec/features/merge_request/user_posts_notes_spec.rb b/spec/features/merge_request/user_posts_notes_spec.rb index 0278d2af08f..ca3503b187c 100644 --- a/spec/features/merge_request/user_posts_notes_spec.rb +++ b/spec/features/merge_request/user_posts_notes_spec.rb @@ -4,8 +4,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User posts notes', :js, feature_category: :code_review_workflow do include NoteInteractionHelpers - include ContentEditorHelpers - let_it_be(:project) { create(:project, :repository) } let(:user) { project.creator } @@ -22,7 +20,6 @@ RSpec.describe 'Merge request > User posts notes', :js, feature_category: :code_ sign_in(user) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end subject { page } diff --git a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb index e8ffca43aa2..4bdef20304a 100644 --- a/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb +++ b/spec/features/merge_request/user_resolves_diff_notes_and_discussions_resolve_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User resolves diff notes and threads', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:guest) { create(:user) } @@ -543,7 +541,5 @@ RSpec.describe 'Merge request > User resolves diff notes and threads', :js, feat # Wait for MR widget to load wait_for_requests - - close_rich_text_promo_popover_if_present end end diff --git a/spec/features/merge_request/user_reverts_merge_request_spec.rb b/spec/features/merge_request/user_reverts_merge_request_spec.rb index 68adc4d47b6..8c782056aa4 100644 --- a/spec/features/merge_request/user_reverts_merge_request_spec.rb +++ b/spec/features/merge_request/user_reverts_merge_request_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'User reverts a merge request', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:merge_request) { create(:merge_request, :simple, source_project: project) } let(:project) { create(:project, :public, :repository) } let(:user) { create(:user) } @@ -15,7 +13,6 @@ RSpec.describe 'User reverts a merge request', :js, feature_category: :code_revi sign_in(user) visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present page.within('.mr-state-widget') do click_button 'Merge' diff --git a/spec/features/merge_request/user_sees_discussions_spec.rb b/spec/features/merge_request/user_sees_discussions_spec.rb index 3482d468bc1..3ca5ac23ddb 100644 --- a/spec/features/merge_request/user_sees_discussions_spec.rb +++ b/spec/features/merge_request/user_sees_discussions_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User sees threads', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project) } @@ -31,7 +29,6 @@ RSpec.describe 'Merge request > User sees threads', :js, feature_category: :code before do visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end context 'active threads' do @@ -74,7 +71,6 @@ RSpec.describe 'Merge request > User sees threads', :js, feature_category: :code before do visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end # TODO: https://gitlab.com/gitlab-org/gitlab-foss/issues/48034 diff --git a/spec/features/merge_request/user_sees_merge_widget_spec.rb b/spec/features/merge_request/user_sees_merge_widget_spec.rb index 1db09790e1c..96cad397441 100644 --- a/spec/features/merge_request/user_sees_merge_widget_spec.rb +++ b/spec/features/merge_request/user_sees_merge_widget_spec.rb @@ -6,7 +6,6 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category: include ProjectForksHelper include TestReportsHelper include ReactiveCachingHelpers - include ContentEditorHelpers let(:project) { create(:project, :repository) } let(:project_only_mwps) { create(:project, :repository, only_allow_merge_if_pipeline_succeeds: true) } @@ -58,7 +57,6 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category: merge_request.update!(head_pipeline: pipeline) deployment.update!(status: :success) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end it 'shows environments link' do @@ -132,7 +130,6 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category: create(:ci_build, :pending, pipeline: pipeline) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end it 'has merge button that shows modal when pipeline does not succeeded' do @@ -409,7 +406,6 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category: before do allow_any_instance_of(Repository).to receive(:merge).and_return(false) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end it 'updates the MR widget', :sidekiq_might_not_need_inline do @@ -431,7 +427,6 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category: sign_in(user2) merge_request.update!(source_project: forked_project) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end it 'user can merge into the target project', :sidekiq_inline do @@ -469,7 +464,6 @@ RSpec.describe 'Merge request > User sees merge widget', :js, feature_category: allow_any_instance_of(MergeRequest).to receive(:merge_ongoing?).and_return(true) visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present wait_for_requests diff --git a/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb b/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb index ad7ed1ceada..92bedc47718 100644 --- a/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb +++ b/spec/features/merge_request/user_sees_notes_from_forked_project_spec.rb @@ -4,7 +4,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User sees notes from forked project', :js, feature_category: :code_review_workflow do include ProjectForksHelper - include ContentEditorHelpers let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } @@ -30,7 +29,6 @@ RSpec.describe 'Merge request > User sees notes from forked project', :js, featu it 'user can reply to the comment', :sidekiq_might_not_need_inline do visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present expect(page).to have_content('A commit comment') diff --git a/spec/features/merge_request/user_sets_to_auto_merge_spec.rb b/spec/features/merge_request/user_sets_to_auto_merge_spec.rb index 4dc0c03aedc..e43c749f93f 100644 --- a/spec/features/merge_request/user_sets_to_auto_merge_spec.rb +++ b/spec/features/merge_request/user_sets_to_auto_merge_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User sets to auto-merge', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) do @@ -42,7 +40,6 @@ RSpec.describe 'Merge request > User sets to auto-merge', :js, feature_category: describe 'setting to auto-merge when pipeline succeeds' do shared_examples 'Set to auto-merge activator' do it 'activates auto-merge feature', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/410055' do - close_rich_text_promo_popover_if_present expect(page).to have_content 'Set to auto-merge' click_button "Set to auto-merge" wait_for_requests @@ -60,7 +57,6 @@ RSpec.describe 'Merge request > User sets to auto-merge', :js, feature_category: context 'when enabled after it was previously canceled' do before do - close_rich_text_promo_popover_if_present click_button "Set to auto-merge" wait_for_requests @@ -119,8 +115,6 @@ RSpec.describe 'Merge request > User sets to auto-merge', :js, feature_category: end it 'allows to cancel the auto-merge', quarantine: 'https://gitlab.com/gitlab-org/gitlab/-/issues/410055' do - close_rich_text_promo_popover_if_present - click_button "Cancel auto-merge" expect(page).to have_button "Set to auto-merge" diff --git a/spec/features/merge_request/user_squashes_merge_request_spec.rb b/spec/features/merge_request/user_squashes_merge_request_spec.rb index 200f310d929..5fd0f353e56 100644 --- a/spec/features/merge_request/user_squashes_merge_request_spec.rb +++ b/spec/features/merge_request/user_squashes_merge_request_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'User squashes a merge request', :js, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:user) { create(:user) } let(:project) { create(:project, :repository) } let(:source_branch) { 'csv' } @@ -14,8 +12,6 @@ RSpec.describe 'User squashes a merge request', :js, feature_category: :code_rev shared_examples 'squash' do it 'squashes the commits into a single commit, and adds a merge commit', :sidekiq_might_not_need_inline do - close_rich_text_promo_popover_if_present - expect(page).to have_content('Merged') latest_master_commits = project.repository.commits_between(original_head.sha, 'master').map(&:raw) @@ -41,16 +37,12 @@ RSpec.describe 'User squashes a merge request', :js, feature_category: :code_rev shared_examples 'no squash' do it 'accepts the merge request without squashing', :sidekiq_might_not_need_inline do - close_rich_text_promo_popover_if_present - expect(page).to have_content('Merged') expect(project.repository).to be_merged_to_root_ref(source_branch) end end def accept_mr - close_rich_text_promo_popover_if_present - expect(page).to have_button('Merge') uncheck 'Delete source branch' unless protected_source_branch diff --git a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb index 1a814aeb89d..6152d9f8259 100644 --- a/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb +++ b/spec/features/merge_request/user_suggests_changes_on_diff_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe 'User comments on a diff', :js, feature_category: :code_review_workflow do include MergeRequestDiffHelpers include RepoHelpers - include ContentEditorHelpers def expect_suggestion_has_content(element, expected_changing_content, expected_suggested_content) changing_content = element.all(:css, '.line_holder.old').map { |el| el.text(normalize_ws: true) } @@ -36,7 +35,6 @@ RSpec.describe 'User comments on a diff', :js, feature_category: :code_review_wo context 'single suggestion note' do it 'hides suggestion popover' do click_diff_line(find_by_scrolling("[id='#{sample_compare.changes[1][:line_code]}']")) - close_rich_text_promo_popover_if_present expect(page).to have_selector('.diff-suggest-popover') diff --git a/spec/features/merge_request/user_views_open_merge_request_spec.rb b/spec/features/merge_request/user_views_open_merge_request_spec.rb index cd0ea639d4d..1a9d40ae926 100644 --- a/spec/features/merge_request/user_views_open_merge_request_spec.rb +++ b/spec/features/merge_request/user_views_open_merge_request_spec.rb @@ -3,8 +3,6 @@ require 'spec_helper' RSpec.describe 'User views an open merge request', feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:merge_request) do create(:merge_request, source_project: project, target_project: project, description: '# Description header') end @@ -55,7 +53,6 @@ RSpec.describe 'User views an open merge request', feature_category: :code_revie sign_in(user) visit(edit_project_merge_request_path(project, merge_request)) - close_rich_text_promo_popover_if_present end it 'renders empty description preview' do diff --git a/spec/features/merge_requests/user_sees_note_updates_in_real_time_spec.rb b/spec/features/merge_requests/user_sees_note_updates_in_real_time_spec.rb index 2c7567b1b40..96f7c26944e 100644 --- a/spec/features/merge_requests/user_sees_note_updates_in_real_time_spec.rb +++ b/spec/features/merge_requests/user_sees_note_updates_in_real_time_spec.rb @@ -4,14 +4,12 @@ require 'spec_helper' RSpec.describe 'Merge request note updates in real time', :js, feature_category: :code_review_workflow do include NoteInteractionHelpers - include ContentEditorHelpers let_it_be(:project) { create(:project, :public, :repository) } let_it_be(:merge_request) { create(:merge_request, source_project: project) } before do visit project_merge_request_path(project, merge_request) - close_rich_text_promo_popover_if_present end describe 'new notes' do diff --git a/spec/features/projects/issuable_templates_spec.rb b/spec/features/projects/issuable_templates_spec.rb index 4221fa26e00..bb43d019701 100644 --- a/spec/features/projects/issuable_templates_spec.rb +++ b/spec/features/projects/issuable_templates_spec.rb @@ -5,7 +5,6 @@ require 'spec_helper' RSpec.describe 'issuable templates', :js, feature_category: :groups_and_projects do include ProjectForksHelper include CookieHelper - include ContentEditorHelpers let(:user) { create(:user) } let(:project) { create(:project, :public, :repository) } @@ -37,7 +36,6 @@ RSpec.describe 'issuable templates', :js, feature_category: :groups_and_projects message: 'added issue template', branch_name: 'master') visit project_issue_path project, issue - close_rich_text_promo_popover_if_present page.find('.js-issuable-edit').click fill_in :'issuable-title', with: 'test issue title' end @@ -81,7 +79,6 @@ RSpec.describe 'issuable templates', :js, feature_category: :groups_and_projects message: 'added issue template', branch_name: 'master') visit project_issue_path project, issue - close_rich_text_promo_popover_if_present page.find('.js-issuable-edit').click fill_in :'issuable-title', with: 'test issue title' fill_in :'issue-description', with: prior_description @@ -111,7 +108,6 @@ RSpec.describe 'issuable templates', :js, feature_category: :groups_and_projects it 'does not overwrite autosaved description' do visit new_project_issue_path project wait_for_requests - close_rich_text_promo_popover_if_present assert_template # default template is loaded the first time @@ -145,7 +141,6 @@ RSpec.describe 'issuable templates', :js, feature_category: :groups_and_projects message: 'added merge request bug template', branch_name: 'master') visit edit_project_merge_request_path project, merge_request - close_rich_text_promo_popover_if_present fill_in :'merge_request[title]', with: 'test merge request title' end @@ -205,7 +200,6 @@ RSpec.describe 'issuable templates', :js, feature_category: :groups_and_projects message: 'added merge request template', branch_name: 'master') visit edit_project_merge_request_path project, merge_request - close_rich_text_promo_popover_if_present fill_in :'merge_request[title]', with: 'test merge request title' end diff --git a/spec/features/projects/work_items/linked_work_items_spec.rb b/spec/features/projects/work_items/linked_work_items_spec.rb index c43e9aca09e..c071a7501f2 100644 --- a/spec/features/projects/work_items/linked_work_items_spec.rb +++ b/spec/features/projects/work_items/linked_work_items_spec.rb @@ -11,7 +11,6 @@ RSpec.describe 'Work item linked items', :js, feature_category: :team_planning d let_it_be(:task) { create(:work_item, :task, project: project, title: 'Task 1') } context 'for signed in user' do - include ContentEditorHelpers before_all do project.add_developer(user) end @@ -25,8 +24,6 @@ RSpec.describe 'Work item linked items', :js, feature_category: :team_planning d visit work_items_path wait_for_requests - - close_rich_text_promo_popover_if_present end it 'are not displayed when issue does not have work item links', :aggregate_failures do diff --git a/spec/features/user_sees_revert_modal_spec.rb b/spec/features/user_sees_revert_modal_spec.rb index 9ee3fe846a6..fdeee6a2808 100644 --- a/spec/features/user_sees_revert_modal_spec.rb +++ b/spec/features/user_sees_revert_modal_spec.rb @@ -4,8 +4,6 @@ require 'spec_helper' RSpec.describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not_need_inline, feature_category: :code_review_workflow do - include ContentEditorHelpers - let(:project) { create(:project, :public, :repository) } let(:user) { project.creator } let(:merge_request) { create(:merge_request, source_project: project) } @@ -24,7 +22,6 @@ RSpec.describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not stub_feature_flags(unbatch_graphql_queries: false) sign_in(user) visit(project_merge_request_path(project, merge_request)) - close_rich_text_promo_popover_if_present page.within('.mr-state-widget') do click_button 'Merge' @@ -40,7 +37,6 @@ RSpec.describe 'Merge request > User sees revert modal', :js, :sidekiq_might_not context 'with page reload validates js correctly loaded' do before do visit(merge_request_path(merge_request)) - close_rich_text_promo_popover_if_present end it_behaves_like 'showing the revert modal' diff --git a/spec/frontend/boards/components/board_form_spec.js b/spec/frontend/boards/components/board_form_spec.js index 15ee3976fb1..a0dacf085e2 100644 --- a/spec/frontend/boards/components/board_form_spec.js +++ b/spec/frontend/boards/components/board_form_spec.js @@ -14,6 +14,7 @@ import createBoardMutation from '~/boards/graphql/board_create.mutation.graphql' import destroyBoardMutation from '~/boards/graphql/board_destroy.mutation.graphql'; import updateBoardMutation from '~/boards/graphql/board_update.mutation.graphql'; import eventHub from '~/boards/eventhub'; +import * as cacheUpdates from '~/boards/graphql/cache_updates'; import { visitUrl } from '~/lib/utils/url_utility'; jest.mock('~/lib/utils/url_utility', () => ({ @@ -55,12 +56,10 @@ describe('BoardForm', () => { const findInput = () => wrapper.find('#board-new-name'); const setBoardMock = jest.fn(); - const setErrorMock = jest.fn(); const store = new Vuex.Store({ actions: { setBoard: setBoardMock, - setError: setErrorMock, }, }); @@ -113,6 +112,10 @@ describe('BoardForm', () => { }); }; + beforeEach(() => { + cacheUpdates.setError = jest.fn(); + }); + describe('when user can not admin the board', () => { beforeEach(() => { createComponent({ @@ -237,7 +240,7 @@ describe('BoardForm', () => { await waitForPromises(); expect(setBoardMock).not.toHaveBeenCalled(); - expect(setErrorMock).toHaveBeenCalled(); + expect(cacheUpdates.setError).toHaveBeenCalled(); }); describe('when Apollo boards FF is on', () => { @@ -353,7 +356,7 @@ describe('BoardForm', () => { await waitForPromises(); expect(setBoardMock).not.toHaveBeenCalled(); - expect(setErrorMock).toHaveBeenCalled(); + expect(cacheUpdates.setError).toHaveBeenCalled(); }); describe('when Apollo boards FF is on', () => { @@ -434,9 +437,11 @@ describe('BoardForm', () => { await waitForPromises(); expect(visitUrl).not.toHaveBeenCalled(); - expect(store.dispatch).toHaveBeenCalledWith('setError', { - message: 'Failed to delete board. Please try again.', - }); + expect(cacheUpdates.setError).toHaveBeenCalledWith( + expect.objectContaining({ + message: 'Failed to delete board. Please try again.', + }), + ); }); }); }); diff --git a/spec/frontend/notes/stores/actions_spec.js b/spec/frontend/notes/stores/actions_spec.js index 104c297b44e..f07ba1e032f 100644 --- a/spec/frontend/notes/stores/actions_spec.js +++ b/spec/frontend/notes/stores/actions_spec.js @@ -1343,8 +1343,6 @@ describe('Actions Notes Store', () => { }); it('dispatches `fetchDiscussionsBatch` action with notes_filter 0 for merge request', () => { - window.gon = { features: { mrActivityFilters: true } }; - return testAction( actions.fetchDiscussions, { path: 'test-path', filter: 'test-filter', persistFilter: 'test-persist-filter' }, @@ -1397,7 +1395,7 @@ describe('Actions Notes Store', () => { type: 'fetchDiscussionsBatch', payload: { config: { - params: { notes_filter: 'test-filter', persist_filter: 'test-persist-filter' }, + params: { notes_filter: 0, persist_filter: false }, }, path: 'test-path', perPage: 20, diff --git a/spec/frontend/vue_shared/components/markdown/editor_mode_switcher_spec.js b/spec/frontend/vue_shared/components/markdown/editor_mode_switcher_spec.js index 712e78458c6..57f54f7e7d3 100644 --- a/spec/frontend/vue_shared/components/markdown/editor_mode_switcher_spec.js +++ b/spec/frontend/vue_shared/components/markdown/editor_mode_switcher_spec.js @@ -1,41 +1,22 @@ import { nextTick } from 'vue'; -import { GlButton, GlLink, GlPopover } from '@gitlab/ui'; +import { GlButton } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import EditorModeSwitcher from '~/vue_shared/components/markdown/editor_mode_switcher.vue'; -import { counter } from '~/vue_shared/components/markdown/utils'; -import UserCalloutDismisser from '~/vue_shared/components/user_callout_dismisser.vue'; -import { stubComponent } from 'helpers/stub_component'; import { useLocalStorageSpy } from 'helpers/local_storage_helper'; -jest.mock('~/vue_shared/components/markdown/utils', () => ({ - counter: jest.fn().mockReturnValue(0), -})); - describe('vue_shared/component/markdown/editor_mode_switcher', () => { let wrapper; useLocalStorageSpy(); - const createComponent = ({ - value, - userCalloutDismisserSlotProps = { dismiss: jest.fn() }, - } = {}) => { + const createComponent = ({ value } = {}) => { wrapper = mount(EditorModeSwitcher, { propsData: { value, }, - stubs: { - UserCalloutDismisser: stubComponent(UserCalloutDismisser, { - render() { - return this.$scopedSlots.default(userCalloutDismisserSlotProps); - }, - }), - }, }); }; const findSwitcherButton = () => wrapper.findComponent(GlButton); - const findUserCalloutDismisser = () => wrapper.findComponent(UserCalloutDismisser); - const findCalloutPopover = () => wrapper.findComponent(GlPopover); describe.each` value | buttonText @@ -54,62 +35,7 @@ describe('vue_shared/component/markdown/editor_mode_switcher', () => { await nextTick(); findSwitcherButton().vm.$emit('click'); - expect(wrapper.emitted().switch).toEqual([[false]]); - }); - }); - - describe('rich text editor callout', () => { - let dismiss; - - beforeEach(() => { - dismiss = jest.fn(); - createComponent({ value: 'markdown', userCalloutDismisserSlotProps: { dismiss } }); - }); - - it('does not skip the user_callout_dismisser query', () => { - expect(findUserCalloutDismisser().props()).toMatchObject({ - skipQuery: false, - featureName: 'rich_text_editor', - }); - }); - - it('mounts new rich text editor popover', () => { - expect(findCalloutPopover().props()).toMatchObject({ - showCloseButton: '', - triggers: 'manual', - target: 'switch-to-rich-text-editor', - }); - }); - - it('dismisses the callout and emits "switch" event when popover close button is clicked', async () => { - await findCalloutPopover().findComponent(GlLink).vm.$emit('click'); - - expect(wrapper.emitted().switch).toEqual([[true]]); - expect(dismiss).toHaveBeenCalled(); - }); - - it('dismisses the callout when action button is clicked', () => { - findSwitcherButton().vm.$emit('click'); - - expect(dismiss).toHaveBeenCalled(); - }); - - it('does not show the callout if rich text is already enabled', async () => { - await wrapper.setProps({ value: 'richText' }); - - expect(findCalloutPopover().props()).toMatchObject({ - show: false, - }); - }); - - it('does not show the callout if already displayed once on the page', () => { - counter.mockReturnValue(1); - - createComponent({ value: 'markdown' }); - - expect(findCalloutPopover().props()).toMatchObject({ - show: false, - }); + expect(wrapper.emitted().switch).toEqual([[]]); }); }); }); diff --git a/spec/frontend/vue_shared/components/markdown/toolbar_spec.js b/spec/frontend/vue_shared/components/markdown/toolbar_spec.js index 90d8ce3b500..59f01b7ff7f 100644 --- a/spec/frontend/vue_shared/components/markdown/toolbar_spec.js +++ b/spec/frontend/vue_shared/components/markdown/toolbar_spec.js @@ -3,7 +3,6 @@ import Toolbar from '~/vue_shared/components/markdown/toolbar.vue'; import EditorModeSwitcher from '~/vue_shared/components/markdown/editor_mode_switcher.vue'; import { updateText } from '~/lib/utils/text_markdown'; import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; -import { PROMO_URL } from 'jh_else_ce/lib/utils/url_utility'; jest.mock('~/lib/utils/text_markdown'); @@ -83,28 +82,5 @@ describe('toolbar', () => { expect(wrapper.emitted('enableContentEditor')).toEqual([[]]); expect(updateText).not.toHaveBeenCalled(); }); - - it('does not insert a template text if textarea has some value', () => { - wrapper.findComponent(EditorModeSwitcher).vm.$emit('switch', true); - - expect(updateText).not.toHaveBeenCalled(); - }); - - it('inserts a "getting started with rich text" template when switched for the first time', () => { - document.querySelector('textarea').value = ''; - - wrapper.findComponent(EditorModeSwitcher).vm.$emit('switch', true); - - expect(updateText).toHaveBeenCalledWith( - expect.objectContaining({ - tag: `### Rich text editor - -Try out **styling** _your_ content right here or read the [direction](${PROMO_URL}/direction/plan/knowledge/content_editor/).`, - textArea: document.querySelector('textarea'), - cursorOffset: 0, - wrap: false, - }), - ); - }); }); }); diff --git a/spec/graphql/resolvers/admin/analytics/usage_trends/measurements_resolver_spec.rb b/spec/graphql/resolvers/admin/analytics/usage_trends/measurements_resolver_spec.rb index 6b5e351a610..6b39f59444f 100644 --- a/spec/graphql/resolvers/admin/analytics/usage_trends/measurements_resolver_spec.rb +++ b/spec/graphql/resolvers/admin/analytics/usage_trends/measurements_resolver_spec.rb @@ -24,7 +24,7 @@ RSpec.describe Resolvers::Admin::Analytics::UsageTrends::MeasurementsResolver do let(:current_user) { admin_user } it 'returns the records, latest first' do - expect(subject).to eq([project_measurement_new, project_measurement_old]) + expect(subject.items).to eq([project_measurement_new, project_measurement_old]) end end @@ -54,7 +54,7 @@ RSpec.describe Resolvers::Admin::Analytics::UsageTrends::MeasurementsResolver do arguments[:recorded_before] = 1.day.ago end - it { is_expected.to match_array([project_measurement_new]) } + it { expect(subject.items).to match_array([project_measurement_new]) } context 'when "incorrect" values are passed' do before do @@ -62,7 +62,7 @@ RSpec.describe Resolvers::Admin::Analytics::UsageTrends::MeasurementsResolver do arguments[:recorded_before] = 4.days.ago end - it { is_expected.to be_empty } + it { expect(subject.items).to be_empty } end end end @@ -71,7 +71,7 @@ RSpec.describe Resolvers::Admin::Analytics::UsageTrends::MeasurementsResolver do let_it_be(:pipelines_succeeded_measurement) { create(:usage_trends_measurement, :pipelines_succeeded_count, recorded_at: 2.days.ago) } let_it_be(:pipelines_skipped_measurement) { create(:usage_trends_measurement, :pipelines_skipped_count, recorded_at: 2.days.ago) } - subject { resolve_measurements({ identifier: identifier }, { current_user: current_user }) } + subject { resolve_measurements({ identifier: identifier }, { current_user: current_user }).items } context 'filter for pipelines_succeeded' do let(:identifier) { 'pipelines_succeeded' } diff --git a/spec/graphql/resolvers/clusters/agent_tokens_resolver_spec.rb b/spec/graphql/resolvers/clusters/agent_tokens_resolver_spec.rb index dfd1addff71..afb10b26907 100644 --- a/spec/graphql/resolvers/clusters/agent_tokens_resolver_spec.rb +++ b/spec/graphql/resolvers/clusters/agent_tokens_resolver_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe Resolvers::Clusters::AgentTokensResolver do include GraphqlHelpers - it { expect(described_class.type).to eq(Types::Clusters::AgentTokenType) } + it { expect(described_class.type).to eq(Types::Clusters::AgentTokenType.connection_type) } it { expect(described_class.null).to be_truthy } it { expect(described_class.arguments.keys).to be_empty } @@ -22,7 +22,7 @@ RSpec.describe Resolvers::Clusters::AgentTokensResolver do subject { resolve(described_class, obj: agent, ctx: ctx) } it 'returns active tokens associated with the agent, ordered by last_used_at' do - expect(subject).to eq([matching_token2, matching_token1]) + expect(subject.items).to eq([matching_token2, matching_token1]) end context 'user does not have permission' do diff --git a/spec/graphql/resolvers/kas/agent_configurations_resolver_spec.rb b/spec/graphql/resolvers/kas/agent_configurations_resolver_spec.rb index e4cf62b0361..8092f841f06 100644 --- a/spec/graphql/resolvers/kas/agent_configurations_resolver_spec.rb +++ b/spec/graphql/resolvers/kas/agent_configurations_resolver_spec.rb @@ -5,7 +5,7 @@ require 'spec_helper' RSpec.describe Resolvers::Kas::AgentConfigurationsResolver do include GraphqlHelpers - it { expect(described_class.type).to eq(Types::Kas::AgentConfigurationType) } + it { expect(described_class.type).to eq(Types::Kas::AgentConfigurationType.connection_type) } it { expect(described_class.null).to be_truthy } it { expect(described_class.field_options).to include(calls_gitaly: true) } @@ -26,7 +26,7 @@ RSpec.describe Resolvers::Kas::AgentConfigurationsResolver do end it 'returns agents configured for the project' do - expect(subject).to contain_exactly(agent1, agent2) + expect(subject.items).to contain_exactly(agent1, agent2) end context 'an error is returned from the KAS client' do @@ -44,7 +44,7 @@ RSpec.describe Resolvers::Kas::AgentConfigurationsResolver do context 'user does not have permission' do let(:user) { create(:user) } - it { is_expected.to be_empty } + it { expect(subject.items).to be_empty } end end end diff --git a/spec/graphql/resolvers/projects_resolver_spec.rb b/spec/graphql/resolvers/projects_resolver_spec.rb index 77507474170..a01404e147b 100644 --- a/spec/graphql/resolvers/projects_resolver_spec.rb +++ b/spec/graphql/resolvers/projects_resolver_spec.rb @@ -6,7 +6,7 @@ RSpec.describe Resolvers::ProjectsResolver do include GraphqlHelpers describe '#resolve' do - subject { resolve(described_class, obj: nil, args: filters, ctx: { current_user: current_user }) } + subject { resolve(described_class, obj: nil, args: filters, ctx: { current_user: current_user }).items } let_it_be(:group) { create(:group, name: 'public-group') } let_it_be(:private_group) { create(:group, name: 'private-group') } diff --git a/spec/support/helpers/content_editor_helpers.rb b/spec/support/helpers/content_editor_helpers.rb index 7597a13e475..7e7ecc197fc 100644 --- a/spec/support/helpers/content_editor_helpers.rb +++ b/spec/support/helpers/content_editor_helpers.rb @@ -1,14 +1,6 @@ # frozen_string_literal: true module ContentEditorHelpers - def close_rich_text_promo_popover_if_present - return unless page.has_css?("[data-testid='rich-text-promo-popover']") - - page.within("[data-testid='rich-text-promo-popover']") do - click_button "Close" - end - end - def switch_to_markdown_editor click_button("Switch to plain text editing") end diff --git a/spec/support/shared_contexts/merge_request_create_shared_context.rb b/spec/support/shared_contexts/merge_request_create_shared_context.rb index bf8eeeb7ab6..fc9a3767365 100644 --- a/spec/support/shared_contexts/merge_request_create_shared_context.rb +++ b/spec/support/shared_contexts/merge_request_create_shared_context.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.shared_context 'merge request create context' do - include ContentEditorHelpers - let(:user) { create(:user) } let(:user2) { create(:user) } let(:target_project) { create(:project, :public, :repository) } @@ -25,7 +23,5 @@ RSpec.shared_context 'merge request create context' do source_branch: 'fix', target_branch: 'master' }) - - close_rich_text_promo_popover_if_present end end diff --git a/spec/support/shared_contexts/merge_request_edit_shared_context.rb b/spec/support/shared_contexts/merge_request_edit_shared_context.rb index 8fe0174b13e..f0e89b0c5f9 100644 --- a/spec/support/shared_contexts/merge_request_edit_shared_context.rb +++ b/spec/support/shared_contexts/merge_request_edit_shared_context.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true RSpec.shared_context 'merge request edit context' do - include ContentEditorHelpers - let(:user) { create(:user) } let(:user2) { create(:user) } let!(:milestone) { create(:milestone, project: target_project) } @@ -27,6 +25,5 @@ RSpec.shared_context 'merge request edit context' do sign_in(user) visit edit_project_merge_request_path(target_project, merge_request) - close_rich_text_promo_popover_if_present end end diff --git a/spec/support/shared_examples/features/discussion_comments_shared_example.rb b/spec/support/shared_examples/features/discussion_comments_shared_example.rb index 82bddb9f5a4..867981297ab 100644 --- a/spec/support/shared_examples/features/discussion_comments_shared_example.rb +++ b/spec/support/shared_examples/features/discussion_comments_shared_example.rb @@ -150,8 +150,6 @@ RSpec.shared_examples 'thread comments for commit and snippet' do |resource_name end RSpec.shared_examples 'thread comments for issue, epic and merge request' do |resource_name| - include ContentEditorHelpers - let(:form_selector) { '.js-main-target-form' } let(:dropdown_selector) { "#{form_selector} .comment-type-dropdown" } let(:toggle_selector) { "#{dropdown_selector} .gl-new-dropdown-toggle" } @@ -161,10 +159,6 @@ RSpec.shared_examples 'thread comments for issue, epic and merge request' do |re let(:comments_selector) { '.timeline > .note.timeline-entry:not(.being-posted)' } let(:comment) { 'My comment' } - before do - close_rich_text_promo_popover_if_present - end - it 'clicking "Comment" will post a comment' do expect(page).to have_selector toggle_selector diff --git a/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb index c3df89c8002..ed885d7a226 100644 --- a/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_creates_wiki_page_shared_examples.rb @@ -6,7 +6,6 @@ RSpec.shared_examples 'User creates wiki page' do include WikiHelpers - include ContentEditorHelpers before do sign_in(user) @@ -19,7 +18,6 @@ RSpec.shared_examples 'User creates wiki page' do wait_for_svg_to_be_loaded(example) click_link "Create your first page" - close_rich_text_promo_popover_if_present end it 'shows all available formats in the dropdown' do @@ -192,7 +190,6 @@ RSpec.shared_examples 'User creates wiki page' do context "via the `new wiki page` page", :js do it "creates a page with a single word" do click_link("New page") - close_rich_text_promo_popover_if_present page.within(".wiki-form") do fill_in(:wiki_title, with: "foo") @@ -211,7 +208,6 @@ RSpec.shared_examples 'User creates wiki page' do it "creates a page with spaces in the name", :js do click_link("New page") - close_rich_text_promo_popover_if_present page.within(".wiki-form") do fill_in(:wiki_title, with: "Spaces in the name") @@ -230,7 +226,6 @@ RSpec.shared_examples 'User creates wiki page' do it "creates a page with hyphens in the name", :js do click_link("New page") - close_rich_text_promo_popover_if_present page.within(".wiki-form") do fill_in(:wiki_title, with: "hyphens-in-the-name") @@ -254,7 +249,6 @@ RSpec.shared_examples 'User creates wiki page' do context 'when a server side validation error is returned' do it "still displays edit form", :js do click_link("New page") - close_rich_text_promo_popover_if_present page.within(".wiki-form") do fill_in(:wiki_title, with: "home") @@ -272,7 +266,6 @@ RSpec.shared_examples 'User creates wiki page' do it "shows the emoji autocompletion dropdown", :js do click_link("New page") - close_rich_text_promo_popover_if_present page.within(".wiki-form") do find("#wiki_content").native.send_keys("") diff --git a/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb index 827c875494a..ca68df9a89b 100644 --- a/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_previews_wiki_changes_shared_examples.rb @@ -5,8 +5,6 @@ # user RSpec.shared_examples 'User previews wiki changes' do - include ContentEditorHelpers - let(:wiki_page) { build(:wiki_page, wiki: wiki) } before do @@ -76,7 +74,6 @@ RSpec.shared_examples 'User previews wiki changes' do before do wiki_page.create # rubocop:disable Rails/SaveBang visit wiki_page_path(wiki, wiki_page, action: :edit) - close_rich_text_promo_popover_if_present end it_behaves_like 'relative links' do diff --git a/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb index d06f04db1ce..05eab2953d7 100644 --- a/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_updates_wiki_page_shared_examples.rb @@ -6,7 +6,6 @@ RSpec.shared_examples 'User updates wiki page' do include WikiHelpers - include ContentEditorHelpers let(:diagramsnet_url) { 'https://embed.diagrams.net' } @@ -23,7 +22,6 @@ RSpec.shared_examples 'User updates wiki page' do wait_for_svg_to_be_loaded(example) click_link "Create your first page" - close_rich_text_promo_popover_if_present end it 'redirects back to the home edit page' do @@ -70,7 +68,6 @@ RSpec.shared_examples 'User updates wiki page' do visit(wiki_path(wiki)) click_link('Edit') - close_rich_text_promo_popover_if_present end it 'updates a page', :js do @@ -164,7 +161,6 @@ RSpec.shared_examples 'User updates wiki page' do before do visit wiki_page_path(wiki, wiki_page, action: :edit) - close_rich_text_promo_popover_if_present end it 'moves the page to the root folder', :js do @@ -235,7 +231,6 @@ RSpec.shared_examples 'User updates wiki page' do stub_application_setting(wiki_page_max_content_bytes: 10) visit wiki_page_path(wiki_page.wiki, wiki_page, action: :edit) - close_rich_text_promo_popover_if_present end it 'allows changing the title if the content does not change', :js do diff --git a/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb b/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb index 3ee7725305e..767caffd417 100644 --- a/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb +++ b/spec/support/shared_examples/features/wiki/user_views_wiki_page_shared_examples.rb @@ -6,7 +6,6 @@ RSpec.shared_examples 'User views a wiki page' do include WikiHelpers - include ContentEditorHelpers let(:path) { 'image.png' } let(:wiki_page) do @@ -270,7 +269,6 @@ RSpec.shared_examples 'User views a wiki page' do wait_for_svg_to_be_loaded click_link "Create your first page" - close_rich_text_promo_popover_if_present expect(page).to have_content('Create New Page') end diff --git a/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb b/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb index 4b27f1f2520..7cbaf40721a 100644 --- a/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb +++ b/spec/support/shared_examples/quick_actions/issuable/close_quick_action_shared_examples.rb @@ -2,7 +2,6 @@ RSpec.shared_examples 'close quick action' do |issuable_type| include Features::NotesHelpers - include ContentEditorHelpers before do project.add_maintainer(maintainer) @@ -77,7 +76,6 @@ RSpec.shared_examples 'close quick action' do |issuable_type| context "preview of note on #{issuable_type}", :js do it 'explains close quick action' do visit public_send("project_#{issuable_type}_path", project, issuable) - close_rich_text_promo_popover_if_present preview_note("this is done, close\n/close") do expect(page).not_to have_content '/close' |