diff --git a/.gitlab/ci/package-and-test/main.gitlab-ci.yml b/.gitlab/ci/package-and-test/main.gitlab-ci.yml index 1f7ed5aa2e6..e621c959e9d 100644 --- a/.gitlab/ci/package-and-test/main.gitlab-ci.yml +++ b/.gitlab/ci/package-and-test/main.gitlab-ci.yml @@ -30,19 +30,6 @@ download-fast-quarantine-report: - .download-fast-quarantine-report - .rules:download-fast-quarantine-report -cache-gems: - extends: - - .qa-install - - .ruby-image - - .rules:update-cache - stage: .pre - tags: - - e2e - script: - - echo "Populated qa cache" - cache: - policy: pull-push - # ========================================== # Test stage # ========================================== diff --git a/.gitlab/ci/preflight.gitlab-ci.yml b/.gitlab/ci/preflight.gitlab-ci.yml index 6a2ea85f393..745d85ab084 100644 --- a/.gitlab/ci/preflight.gitlab-ci.yml +++ b/.gitlab/ci/preflight.gitlab-ci.yml @@ -44,7 +44,9 @@ rails-production-server-boot-puma-cng: extends: - .rails-production-server-boot script: - - curl --silent https://gitlab.com/gitlab-org/build/CNG/-/raw/master/gitlab-webservice/configuration/puma.rb > config/puma.rb + - define_trigger_branch_in_build_env + - echo "TRIGGER_BRANCH is defined as ${TRIGGER_BRANCH}" + - curl --silent "https://gitlab.com/gitlab-org/build/CNG/-/raw/${TRIGGER_BRANCH}/gitlab-webservice/configuration/puma.rb" > config/puma.rb - sed --in-place "s:/srv/gitlab:${PWD}:" config/puma.rb - bundle exec puma --environment production --config config/puma.rb & - sleep 40 # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/114124#note_1309506358 diff --git a/.gitlab/ci/qa-common/main.gitlab-ci.yml b/.gitlab/ci/qa-common/main.gitlab-ci.yml index c44aa327762..f263c72aed7 100644 --- a/.gitlab/ci/qa-common/main.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/main.gitlab-ci.yml @@ -14,7 +14,7 @@ include: gitlab_auth_token_variable_name: "PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE" allure_job_name: "${QA_RUN_TYPE}" - project: gitlab-org/quality/pipeline-common - ref: 7.10.2 + ref: 7.12.1 file: - /ci/base.gitlab-ci.yml - /ci/knapsack-report.yml diff --git a/.gitlab/ci/qa-common/rules.gitlab-ci.yml b/.gitlab/ci/qa-common/rules.gitlab-ci.yml index 7fa66fa4384..36c601261d8 100644 --- a/.gitlab/ci/qa-common/rules.gitlab-ci.yml +++ b/.gitlab/ci/qa-common/rules.gitlab-ci.yml @@ -64,10 +64,6 @@ rules: - when: always -.rules:update-cache: - rules: - - if: '$UPDATE_QA_CACHE == "true"' - .rules:download-knapsack: rules: - when: always diff --git a/.gitlab/ci/qa.gitlab-ci.yml b/.gitlab/ci/qa.gitlab-ci.yml index 7c72c301aef..cbb68985bb4 100644 --- a/.gitlab/ci/qa.gitlab-ci.yml +++ b/.gitlab/ci/qa.gitlab-ci.yml @@ -62,15 +62,21 @@ qa:master-auto-quarantine-dequarantine: - bundle exec confiner -r .confiner/master.yml allow_failure: true -qa:update-qa-cache: +cache-qa-gems: extends: - .qa-job-base - .qa-cache-push - - .shared:rules:update-cache + - .qa:rules:update-gem-cache stage: prepare script: - echo "Cache has been updated and ready to be uploaded." +# E2E runners have separate infra setup and different cache bucket +cache-qa-gems-e2e-runners: + extends: cache-qa-gems + tags: + - e2e + trigger-omnibus: stage: qa extends: diff --git a/.gitlab/ci/rules.gitlab-ci.yml b/.gitlab/ci/rules.gitlab-ci.yml index 00b10c2ae2b..866a1843744 100644 --- a/.gitlab/ci/rules.gitlab-ci.yml +++ b/.gitlab/ci/rules.gitlab-ci.yml @@ -1443,6 +1443,16 @@ ############ # QA rules # ############ +.qa:rules:update-gem-cache: + rules: + - <<: *if-default-refs + changes: + - qa/Gemfile.lock + - <<: *if-schedule-maintenance + - <<: *if-security-schedule + - <<: *if-foss-schedule + - <<: *if-merge-request-labels-update-caches + .qa:rules:code-merge-request-manual: rules: - <<: *if-merge-request @@ -1592,11 +1602,6 @@ - <<: *if-merge-request changes: *ci-qa-patterns allow_failure: true - - <<: *if-merge-request - changes: - - qa/Gemfile.lock # qa/Gemfile.lock is a part of *qa-patterns, so this rule must be placed before the one with *qa-patterns changes - variables: - UPDATE_QA_CACHE: "true" - <<: *if-merge-request changes: *qa-patterns allow_failure: true @@ -1636,11 +1641,6 @@ when: manual - <<: *if-merge-request changes: *nodejs-patterns - - <<: *if-merge-request - changes: - - qa/Gemfile.lock # qa/Gemfile.lock is a part of *qa-patterns, so this rule must be placed before the one with *qa-patterns changes - variables: - UPDATE_QA_CACHE: "true" - <<: *if-dot-com-gitlab-org-and-security-merge-request-and-qa-tests-specified changes: *code-patterns - <<: *if-merge-request @@ -1657,7 +1657,6 @@ CREATE_TEST_FAILURE_ISSUES: "true" PROCESS_TEST_RESULTS: "true" KNAPSACK_GENERATE_REPORT: "true" - UPDATE_QA_CACHE: "true" QA_SAVE_TEST_METRICS: "true" QA_EXPORT_TEST_METRICS: "false" # on main runs, metrics are exported to separate bucket via rake task for better consistency diff --git a/.gitlab/ci/setup.gitlab-ci.yml b/.gitlab/ci/setup.gitlab-ci.yml index cc5e9bd2985..a101901d57b 100644 --- a/.gitlab/ci/setup.gitlab-ci.yml +++ b/.gitlab/ci/setup.gitlab-ci.yml @@ -197,8 +197,7 @@ trigger-omnibus-env: echo "NEXT_RUBY_VERSION=${NEXT_RUBY_VERSION}" >> $BUILD_ENV echo "GITLAB_ASSETS_TAG=$(assets_image_tag)" >> $BUILD_ENV echo "EE=$([[ $FOSS_ONLY == '1' ]] && echo 'false' || echo 'true')" >> $BUILD_ENV - target_branch_name="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_COMMIT_REF_NAME}}" - echo "TRIGGER_BRANCH=$([[ "${target_branch_name}" =~ ^[0-9-]+-stable(-ee)?$ ]] && echo ${target_branch_name%-ee} || echo 'master')" >> $BUILD_ENV + define_trigger_branch_in_build_env - | echo "Built environment file for omnibus build:" cat $BUILD_ENV diff --git a/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml b/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml index f0a5ea5090f..d56564b1295 100644 --- a/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml +++ b/.gitlab/ci/test-on-gdk/main.gitlab-ci.yml @@ -124,17 +124,6 @@ download-knapsack-report: - .download-knapsack-report - .rules:download-knapsack -cache-gems: - extends: - - .ruby-image - - .qa-cache-push - - .rules:update-cache - stage: .pre - tags: - - e2e - script: - - cd qa && bundle install - # Take the existing GDK docker image and reconfigure it with Postgres load # balancing. Adding 5s lag to 1 of the replicas to validate robustness of # the load balancer. diff --git a/GITALY_SERVER_VERSION b/GITALY_SERVER_VERSION index 40ee5c26ff4..42b84f073a4 100644 --- a/GITALY_SERVER_VERSION +++ b/GITALY_SERVER_VERSION @@ -1 +1 @@ -db9003ccaed4618cb6c9e1d8ce99f7794c868a65 +6835085898eb8d3881ee98c476a7bfc2981f0067 diff --git a/app/assets/javascripts/admin/abuse_report/components/abuse_report_notes.vue b/app/assets/javascripts/admin/abuse_report/components/abuse_report_notes.vue index 80af7d7400a..29de7e1ad1d 100644 --- a/app/assets/javascripts/admin/abuse_report/components/abuse_report_notes.vue +++ b/app/assets/javascripts/admin/abuse_report/components/abuse_report_notes.vue @@ -6,6 +6,7 @@ import SkeletonLoadingContainer from '~/vue_shared/components/notes/skeleton_not import { SKELETON_NOTES_COUNT } from '~/admin/abuse_report/constants'; import abuseReportNotesQuery from '../graphql/notes/abuse_report_notes.query.graphql'; import AbuseReportDiscussion from './notes/abuse_report_discussion.vue'; +import AbuseReportAddNote from './notes/abuse_report_add_note.vue'; export default { name: 'AbuseReportNotes', @@ -16,6 +17,7 @@ export default { components: { SkeletonLoadingContainer, AbuseReportDiscussion, + AbuseReportAddNote, }, props: { abuseReportId: { @@ -60,6 +62,9 @@ export default { const discussionId = discussion.notes.nodes[0].id; return discussionId.split('/')[discussionId.split('/').length - 1]; }, + updateKey() { + this.addNoteKey = uniqueId(`abuse-report-add-note-${this.abuseReportId}`); + }, }, }; @@ -86,6 +91,16 @@ export default { :abuse-report-id="abuseReportId" /> +
+ {{ $options.I18N.learnBasics.migrateFromJenkins.description }} +
{{ $options.I18N.learnBasics.gettingStarted.description }}
-+ {{ $options.I18N.learnBasics.gettingStarted.description }} +
+Another comment
', + createdAt: '2023-11-02T02:45:46Z', + lastEditedAt: '2023-11-02T02:45:46Z', + url: 'http://127.0.0.1:3000/admin/abuse_reports/20#note_6', + resolved: false, + author: { + id: 'gid://gitlab/User/1', + avatarUrl: + 'https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon', + name: 'Administrator', + username: 'root', + webUrl: 'http://127.0.0.1:3000/root', + }, + lastEditedBy: null, + userPermissions: { + adminNote: true, + }, + discussion: { + id: 'gid://gitlab/Discussion/90ca230051611e6e1676c50ba7178e0baeabd98d', + notes: { + nodes: [ + { + id: 'gid://gitlab/Note/6', + }, + ], + }, + }, + }, + ], + }, + }, + }, + errors: [], + }, + }, +}; diff --git a/spec/frontend/analytics/cycle_analytics/store/actions_spec.js b/spec/frontend/analytics/cycle_analytics/store/actions_spec.js index c3551d3da6f..897d75573f0 100644 --- a/spec/frontend/analytics/cycle_analytics/store/actions_spec.js +++ b/spec/frontend/analytics/cycle_analytics/store/actions_spec.js @@ -141,7 +141,7 @@ describe('Project Value Stream Analytics actions', () => { describe('without a selected stage', () => { it('will select the first stage from the value stream', () => { const [firstStage] = allowedStages; - testAction({ + return testAction({ action: actions.setInitialStage, state, payload: null, @@ -154,7 +154,7 @@ describe('Project Value Stream Analytics actions', () => { describe('with no value stream stages available', () => { it('will return SET_NO_ACCESS_ERROR', () => { state = { ...state, stages: [] }; - testAction({ + return testAction({ action: actions.setInitialStage, state, payload: null, @@ -299,25 +299,23 @@ describe('Project Value Stream Analytics actions', () => { name: 'mock default', }; const mockValueStreams = [mockValueStream, selectedValueStream]; - it('with data, will set the first value stream', () => { + it('with data, will set the first value stream', () => testAction({ action: actions.receiveValueStreamsSuccess, state, payload: mockValueStreams, expectedMutations: [{ type: 'RECEIVE_VALUE_STREAMS_SUCCESS', payload: mockValueStreams }], expectedActions: [{ type: 'setSelectedValueStream', payload: mockValueStream }], - }); - }); + })); - it('without data, will set the default value stream', () => { + it('without data, will set the default value stream', () => testAction({ action: actions.receiveValueStreamsSuccess, state, payload: [], expectedMutations: [{ type: 'RECEIVE_VALUE_STREAMS_SUCCESS', payload: [] }], expectedActions: [{ type: 'setSelectedValueStream', payload: selectedValueStream }], - }); - }); + })); }); describe('fetchValueStreamStages', () => { diff --git a/spec/frontend/boards/stores/actions_spec.js b/spec/frontend/boards/stores/actions_spec.js index 358cb340802..616bb083211 100644 --- a/spec/frontend/boards/stores/actions_spec.js +++ b/spec/frontend/boards/stores/actions_spec.js @@ -165,7 +165,7 @@ describe('setFilters', () => { issuableType: TYPE_ISSUE, }; - testAction( + return testAction( actions.setFilters, filters, state, @@ -441,7 +441,7 @@ describe('fetchMilestones', () => { describe('createList', () => { it('should dispatch createIssueList action', () => { - testAction({ + return testAction({ action: actions.createList, payload: { backlog: true }, expectedActions: [{ type: 'createIssueList', payload: { backlog: true } }], @@ -560,7 +560,7 @@ describe('addList', () => { }; it('should commit RECEIVE_ADD_LIST_SUCCESS mutation and dispatch fetchItemsForList action', () => { - testAction({ + return testAction({ action: actions.addList, payload: mockLists[1], state: { ...getters }, @@ -1007,7 +1007,7 @@ describe('moveItem', () => { it('should dispatch moveIssue action with payload', () => { const payload = { mock: 'payload' }; - testAction({ + return testAction({ action: actions.moveItem, payload, expectedActions: [{ type: 'moveIssue', payload }], @@ -1017,7 +1017,7 @@ describe('moveItem', () => { describe('moveIssue', () => { it('should dispatch a correct set of actions', () => { - testAction({ + return testAction({ action: actions.moveIssue, payload: mockMoveIssueParams, state: mockMoveState, @@ -1092,7 +1092,7 @@ describe('moveIssueCard and undoMoveIssueCard', () => { }); it('moveIssueCard commits a correct set of actions', () => { - testAction({ + return testAction({ action: actions.moveIssueCard, state, payload: getMoveData(state, params), @@ -1101,7 +1101,7 @@ describe('moveIssueCard and undoMoveIssueCard', () => { }); it('undoMoveIssueCard commits a correct set of actions', () => { - testAction({ + return testAction({ action: actions.undoMoveIssueCard, state, payload: getMoveData(state, params), @@ -1169,7 +1169,7 @@ describe('moveIssueCard and undoMoveIssueCard', () => { }); it('moveIssueCard commits a correct set of actions', () => { - testAction({ + return testAction({ action: actions.moveIssueCard, state, payload: getMoveData(state, params), @@ -1178,7 +1178,7 @@ describe('moveIssueCard and undoMoveIssueCard', () => { }); it('undoMoveIssueCard commits a correct set of actions', () => { - testAction({ + return testAction({ action: actions.undoMoveIssueCard, state, payload: getMoveData(state, params), @@ -1244,7 +1244,7 @@ describe('moveIssueCard and undoMoveIssueCard', () => { }); it('moveIssueCard commits a correct set of actions', () => { - testAction({ + return testAction({ action: actions.moveIssueCard, state, payload: getMoveData(state, params), @@ -1253,7 +1253,7 @@ describe('moveIssueCard and undoMoveIssueCard', () => { }); it('undoMoveIssueCard commits a correct set of actions', () => { - testAction({ + return testAction({ action: actions.undoMoveIssueCard, state, payload: getMoveData(state, params), @@ -1298,7 +1298,7 @@ describe('updateMovedIssueCard', () => { ])( 'should commit UPDATE_BOARD_ITEM with a correctly updated issue data when %s', (_, { state, moveData, updatedIssue }) => { - testAction({ + return testAction({ action: actions.updateMovedIssue, payload: moveData, state, @@ -1363,7 +1363,7 @@ describe('updateIssueOrder', () => { }, }); - testAction( + return testAction( actions.updateIssueOrder, { moveData }, state, @@ -1395,7 +1395,7 @@ describe('updateIssueOrder', () => { }, }); - testAction( + return testAction( actions.updateIssueOrder, { moveData }, state, @@ -1448,7 +1448,7 @@ describe('addListItem', () => { inProgress: true, }; - testAction( + return testAction( actions.addListItem, payload, {}, @@ -1475,7 +1475,7 @@ describe('addListItem', () => { position: 0, }; - testAction( + return testAction( actions.addListItem, payload, {}, @@ -1503,7 +1503,7 @@ describe('removeListItem', () => { itemId: mockIssue.id, }; - testAction(actions.removeListItem, payload, {}, [ + return testAction(actions.removeListItem, payload, {}, [ { type: types.REMOVE_BOARD_ITEM_FROM_LIST, payload }, { type: types.REMOVE_BOARD_ITEM, payload: mockIssue.id }, ]); @@ -1608,7 +1608,7 @@ describe('addListNewIssue', () => { }, }); - testAction({ + return testAction({ action: actions.addListNewIssue, payload: { issueInput: mockIssue, @@ -1651,7 +1651,7 @@ describe('addListNewIssue', () => { }, }); - testAction({ + return testAction({ action: actions.addListNewIssue, payload: { issueInput: mockIssue, @@ -1700,7 +1700,7 @@ describe('setActiveIssueLabels', () => { value: labels, }; - testAction( + return testAction( actions.setActiveIssueLabels, input, { ...state, ...getters }, @@ -1721,7 +1721,7 @@ describe('setActiveIssueLabels', () => { value: [labels[1]], }; - testAction( + return testAction( actions.setActiveIssueLabels, { ...input, removeLabelIds: [getIdFromGraphQLId(labels[0].id)] }, { ...state, ...getters }, @@ -1962,7 +1962,7 @@ describe('toggleBoardItemMultiSelection', () => { const boardItem2 = mockIssue2; it('should commit mutation ADD_BOARD_ITEM_TO_SELECTION if item is not on selection state', () => { - testAction( + return testAction( actions.toggleBoardItemMultiSelection, boardItem, { selectedBoardItems: [] }, @@ -1977,7 +1977,7 @@ describe('toggleBoardItemMultiSelection', () => { }); it('should commit mutation REMOVE_BOARD_ITEM_FROM_SELECTION if item is on selection state', () => { - testAction( + return testAction( actions.toggleBoardItemMultiSelection, boardItem, { selectedBoardItems: [mockIssue] }, @@ -1992,7 +1992,7 @@ describe('toggleBoardItemMultiSelection', () => { }); it('should additionally commit mutation ADD_BOARD_ITEM_TO_SELECTION for active issue and dispatch unsetActiveId', () => { - testAction( + return testAction( actions.toggleBoardItemMultiSelection, boardItem2, { activeId: mockActiveIssue.id, activeBoardItem: mockActiveIssue, selectedBoardItems: [] }, @@ -2013,7 +2013,7 @@ describe('toggleBoardItemMultiSelection', () => { describe('resetBoardItemMultiSelection', () => { it('should commit mutation RESET_BOARD_ITEM_SELECTION', () => { - testAction({ + return testAction({ action: actions.resetBoardItemMultiSelection, state: { selectedBoardItems: [mockIssue] }, expectedMutations: [ @@ -2027,7 +2027,7 @@ describe('resetBoardItemMultiSelection', () => { describe('toggleBoardItem', () => { it('should dispatch resetBoardItemMultiSelection and unsetActiveId when boardItem is the active item', () => { - testAction({ + return testAction({ action: actions.toggleBoardItem, payload: { boardItem: mockIssue }, state: { @@ -2038,7 +2038,7 @@ describe('toggleBoardItem', () => { }); it('should dispatch resetBoardItemMultiSelection and setActiveId when boardItem is not the active item', () => { - testAction({ + return testAction({ action: actions.toggleBoardItem, payload: { boardItem: mockIssue }, state: { @@ -2054,7 +2054,7 @@ describe('toggleBoardItem', () => { describe('setError', () => { it('should commit mutation SET_ERROR', () => { - testAction({ + return testAction({ action: actions.setError, payload: { message: 'mayday' }, expectedMutations: [ @@ -2085,7 +2085,7 @@ describe('setError', () => { describe('unsetError', () => { it('should commit mutation SET_ERROR with undefined as payload', () => { - testAction({ + return testAction({ action: actions.unsetError, expectedMutations: [ { diff --git a/spec/frontend/ci/pipelines_page/components/empty_state/pipelines_ci_templates_spec.js b/spec/frontend/ci/pipelines_page/components/empty_state/pipelines_ci_templates_spec.js index fbef4aa08eb..f824dab9ae1 100644 --- a/spec/frontend/ci/pipelines_page/components/empty_state/pipelines_ci_templates_spec.js +++ b/spec/frontend/ci/pipelines_page/components/empty_state/pipelines_ci_templates_spec.js @@ -1,4 +1,5 @@ import '~/commons'; +import { GlButton } from '@gitlab/ui'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; import PipelinesCiTemplates from '~/ci/pipelines_page/components/empty_state/pipelines_ci_templates.vue'; @@ -14,12 +15,15 @@ describe('Pipelines CI Templates', () => { return shallowMountExtended(PipelinesCiTemplates, { provide: { pipelineEditorPath, + showJenkinsCiPrompt: false, ...propsData, }, stubs, }); }; + const findMigrateFromJenkinsPrompt = () => wrapper.findByTestId('migrate-from-jenkins-prompt'); + const findMigrationPlanBtn = () => findMigrateFromJenkinsPrompt().findComponent(GlButton); const findTestTemplateLink = () => wrapper.findByTestId('test-template-link'); const findCiTemplates = () => wrapper.findComponent(CiTemplates); @@ -34,6 +38,27 @@ describe('Pipelines CI Templates', () => { ); expect(findCiTemplates().exists()).toBe(true); }); + + it('does not show migrate from jenkins prompt', () => { + expect(findMigrateFromJenkinsPrompt().exists()).toBe(false); + }); + + describe('when Jenkinsfile is detected', () => { + beforeEach(() => { + wrapper = createWrapper({ showJenkinsCiPrompt: true }); + }); + + it('shows migrate from jenkins prompt', () => { + expect(findMigrateFromJenkinsPrompt().exists()).toBe(true); + }); + + it('opens correct link in new tab after clicking migration plan CTA', () => { + expect(findMigrationPlanBtn().attributes('href')).toBe( + '/help/ci/migration/plan_a_migration', + ); + expect(findMigrationPlanBtn().attributes('target')).toBe('_blank'); + }); + }); }); describe('tracking', () => { @@ -54,5 +79,27 @@ describe('Pipelines CI Templates', () => { label: 'Getting-Started', }); }); + + describe('when Jenkinsfile detected', () => { + beforeEach(() => { + wrapper = createWrapper({ showJenkinsCiPrompt: true }); + }); + + it('creates render event on page load', () => { + expect(trackingSpy).toHaveBeenCalledTimes(1); + expect(trackingSpy).toHaveBeenCalledWith(undefined, 'render', { + label: 'migrate_from_jenkins_prompt', + }); + }); + + it('sends an event when migration plan is clicked', () => { + findMigrationPlanBtn().vm.$emit('click'); + + expect(trackingSpy).toHaveBeenCalledTimes(2); + expect(trackingSpy).toHaveBeenCalledWith(undefined, 'template_clicked', { + label: 'migrate_from_jenkins_prompt', + }); + }); + }); }); }); diff --git a/spec/frontend/ci/pipelines_page/pipelines_spec.js b/spec/frontend/ci/pipelines_page/pipelines_spec.js index 97192058ff6..f3c28b17339 100644 --- a/spec/frontend/ci/pipelines_page/pipelines_spec.js +++ b/spec/frontend/ci/pipelines_page/pipelines_spec.js @@ -110,6 +110,7 @@ describe('Pipelines', () => { suggestedCiTemplates: [], ciRunnerSettingsPath: defaultProps.ciRunnerSettingsPath, anyRunnersAvailable: true, + showJenkinsCiPrompt: false, }, propsData: { ...defaultProps, diff --git a/spec/frontend/deploy_freeze/store/actions_spec.js b/spec/frontend/deploy_freeze/store/actions_spec.js index d39577baa59..86b72c673bc 100644 --- a/spec/frontend/deploy_freeze/store/actions_spec.js +++ b/spec/frontend/deploy_freeze/store/actions_spec.js @@ -36,7 +36,7 @@ describe('deploy freeze store actions', () => { describe('setSelectedFreezePeriod', () => { it('commits SET_SELECTED_TIMEZONE mutation', () => { - testAction( + return testAction( actions.setFreezePeriod, { id: 3, @@ -69,7 +69,7 @@ describe('deploy freeze store actions', () => { describe('setSelectedTimezone', () => { it('commits SET_SELECTED_TIMEZONE mutation', () => { - testAction(actions.setSelectedTimezone, {}, {}, [ + return testAction(actions.setSelectedTimezone, {}, {}, [ { payload: {}, type: types.SET_SELECTED_TIMEZONE, @@ -80,7 +80,7 @@ describe('deploy freeze store actions', () => { describe('setFreezeStartCron', () => { it('commits SET_FREEZE_START_CRON mutation', () => { - testAction(actions.setFreezeStartCron, {}, {}, [ + return testAction(actions.setFreezeStartCron, {}, {}, [ { type: types.SET_FREEZE_START_CRON, }, @@ -90,7 +90,7 @@ describe('deploy freeze store actions', () => { describe('setFreezeEndCron', () => { it('commits SET_FREEZE_END_CRON mutation', () => { - testAction(actions.setFreezeEndCron, {}, {}, [ + return testAction(actions.setFreezeEndCron, {}, {}, [ { type: types.SET_FREEZE_END_CRON, }, diff --git a/spec/frontend/diffs/store/actions_spec.js b/spec/frontend/diffs/store/actions_spec.js index f20ac3c080d..88c03cbaece 100644 --- a/spec/frontend/diffs/store/actions_spec.js +++ b/spec/frontend/diffs/store/actions_spec.js @@ -631,7 +631,7 @@ describe('DiffsStoreActions', () => { describe('prefetchFileNeighbors', () => { it('dispatches two requests to prefetch the next/previous files', () => { - testAction( + return testAction( diffActions.prefetchFileNeighbors, {}, { diff --git a/spec/frontend/error_tracking/store/list/actions_spec.js b/spec/frontend/error_tracking/store/list/actions_spec.js index 24a26476455..622195defa1 100644 --- a/spec/frontend/error_tracking/store/list/actions_spec.js +++ b/spec/frontend/error_tracking/store/list/actions_spec.js @@ -57,7 +57,7 @@ describe('error tracking actions', () => { describe('restartPolling', () => { it('should restart polling', () => { - testAction( + return testAction( actions.restartPolling, {}, {}, @@ -74,7 +74,7 @@ describe('error tracking actions', () => { it('should search by query', () => { const query = 'search'; - testAction( + return testAction( actions.searchByQuery, query, {}, @@ -92,7 +92,7 @@ describe('error tracking actions', () => { it('should search errors by status', () => { const status = 'ignored'; - testAction( + return testAction( actions.filterByStatus, status, {}, @@ -106,7 +106,7 @@ describe('error tracking actions', () => { it('should search by query', () => { const field = 'frequency'; - testAction( + return testAction( actions.sortByField, field, {}, @@ -123,7 +123,7 @@ describe('error tracking actions', () => { it('should set search endpoint', () => { const endpoint = 'https://sentry.io'; - testAction( + return testAction( actions.setEndpoint, { endpoint }, {}, @@ -136,7 +136,7 @@ describe('error tracking actions', () => { describe('fetchPaginatedResults', () => { it('should start polling the selected page cursor', () => { const cursor = '1576637570000:1:1'; - testAction( + return testAction( actions.fetchPaginatedResults, cursor, {}, diff --git a/spec/frontend/header_spec.js b/spec/frontend/header_spec.js deleted file mode 100644 index 13c11863443..00000000000 --- a/spec/frontend/header_spec.js +++ /dev/null @@ -1,107 +0,0 @@ -import htmlOpenIssue from 'test_fixtures/issues/open-issue.html'; -import { mockTracking, unmockTracking } from 'helpers/tracking_helper'; -import initTodoToggle, { initNavUserDropdownTracking } from '~/header'; -import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; - -// TODO: Remove this with the removal of the old navigation. -// See https://gitlab.com/groups/gitlab-org/-/epics/11875. -// -// This and ~/header will be removed. These tests no longer work due to the -// corresponding fixtures changing for -// https://gitlab.com/gitlab-org/gitlab/-/issues/420121. -// eslint-disable-next-line jest/no-disabled-tests -describe.skip('Header', () => { - describe('Todos notification', () => { - const todosPendingCount = '.js-todos-count'; - - function isTodosCountHidden() { - return document.querySelector(todosPendingCount).classList.contains('hidden'); - } - - function triggerToggle(newCount) { - const event = new CustomEvent('todo:toggle', { - detail: { - count: newCount, - }, - }); - - document.dispatchEvent(event); - } - - beforeEach(() => { - initTodoToggle(); - setHTMLFixture(htmlOpenIssue); - }); - - afterEach(() => { - resetHTMLFixture(); - }); - - it('should update todos-count after receiving the todo:toggle event', () => { - triggerToggle(5); - - expect(document.querySelector(todosPendingCount).textContent).toEqual('5'); - }); - - it('should hide todos-count when it is 0', () => { - triggerToggle(0); - - expect(isTodosCountHidden()).toEqual(true); - }); - - it('should show todos-count when it is more than 0', () => { - triggerToggle(10); - - expect(isTodosCountHidden()).toEqual(false); - }); - - describe('when todos-count is 1000', () => { - beforeEach(() => { - triggerToggle(1000); - }); - - it('should show todos-count', () => { - expect(isTodosCountHidden()).toEqual(false); - }); - - it('should show 99+ for todos-count', () => { - expect(document.querySelector(todosPendingCount).textContent).toEqual('99+'); - }); - }); - }); - - describe('Track user dropdown open', () => { - let trackingSpy; - - beforeEach(() => { - setHTMLFixture(` -
+
+
+