diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-15 21:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-15 21:10:36 +0300 |
commit | 99aa31992d4398d35c9df4854f5fb494984a9e0b (patch) | |
tree | c2ca79f7ea8e5daaf8e62b5d523a986331d97647 /spec/frontend | |
parent | 229395d3af51cd46a9179f2eba142c027d08b208 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend')
84 files changed, 489 insertions, 249 deletions
diff --git a/spec/frontend/access_tokens/index_spec.js b/spec/frontend/access_tokens/index_spec.js index 0c611a4a512..55575ab25fc 100644 --- a/spec/frontend/access_tokens/index_spec.js +++ b/spec/frontend/access_tokens/index_spec.js @@ -182,7 +182,7 @@ describe('access tokens', () => { }); describe('initTokensApp', () => { - it('mounts the component and provides`tokenTypes` ', () => { + it('mounts the component and provides`tokenTypes`', () => { const tokensData = { [FEED_TOKEN]: FEED_TOKEN, [INCOMING_EMAIL_TOKEN]: INCOMING_EMAIL_TOKEN, diff --git a/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js b/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js index 286a8b92282..1d57473943b 100644 --- a/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js +++ b/spec/frontend/add_context_commits_modal/components/add_context_commits_modal_spec.js @@ -112,7 +112,7 @@ describe('AddContextCommitsModal', () => { }); describe('has an ok button when clicked calls action', () => { - it('"createContextCommits" when only new commits to be added ', async () => { + it('"createContextCommits" when only new commits to be added', async () => { wrapper.vm.$store.state.selectedCommits = [{ ...commit, isSelected: true }]; findModal().vm.$emit('ok'); await nextTick(); @@ -121,7 +121,7 @@ describe('AddContextCommitsModal', () => { forceReload: true, }); }); - it('"removeContextCommits" when only added commits are to be removed ', async () => { + it('"removeContextCommits" when only added commits are to be removed', async () => { wrapper.vm.$store.state.toRemoveCommits = [commit.short_id]; findModal().vm.$emit('ok'); await nextTick(); diff --git a/spec/frontend/admin/analytics/devops_score/components/devops_score_spec.js b/spec/frontend/admin/analytics/devops_score/components/devops_score_spec.js index 534af2a3033..de56e843eb9 100644 --- a/spec/frontend/admin/analytics/devops_score/components/devops_score_spec.js +++ b/spec/frontend/admin/analytics/devops_score/components/devops_score_spec.js @@ -34,7 +34,7 @@ describe('DevopsScore', () => { createComponent({ devopsScoreMetrics: {} }); }); - it('includes the DevopsScoreCallout component ', () => { + it('includes the DevopsScoreCallout component', () => { expect(bannerExists()).toBe(true); }); @@ -67,7 +67,7 @@ describe('DevopsScore', () => { createComponent(); }); - it('includes the DevopsScoreCallout component ', () => { + it('includes the DevopsScoreCallout component', () => { expect(bannerExists()).toBe(true); }); diff --git a/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js b/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js index aa9bee59e8c..0266adeb6c7 100644 --- a/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js +++ b/spec/frontend/alerts_settings/components/alerts_settings_wrapper_spec.js @@ -148,7 +148,7 @@ describe('AlertsSettingsWrapper', () => { expect(findIntegrations()).toHaveLength(mockIntegrations.length); }); - it('renders `Add new integration` button when multiple integrations are supported ', () => { + it('renders `Add new integration` button when multiple integrations are supported', () => { createComponent({ data: { integrations: mockIntegrations, @@ -321,7 +321,7 @@ describe('AlertsSettingsWrapper', () => { }); }); - it('shows an error alert when integration creation fails ', async () => { + it('shows an error alert when integration creation fails', async () => { jest.spyOn(wrapper.vm.$apollo, 'mutate').mockRejectedValue(ADD_INTEGRATION_ERROR); findAlertsSettingsForm().vm.$emit('create-new-integration', {}); @@ -330,7 +330,7 @@ describe('AlertsSettingsWrapper', () => { expect(createFlash).toHaveBeenCalledWith({ message: ADD_INTEGRATION_ERROR }); }); - it('shows an error alert when integration token reset fails ', async () => { + it('shows an error alert when integration token reset fails', async () => { jest.spyOn(wrapper.vm.$apollo, 'mutate').mockRejectedValue(RESET_INTEGRATION_TOKEN_ERROR); findAlertsSettingsForm().vm.$emit('reset-token', {}); @@ -339,7 +339,7 @@ describe('AlertsSettingsWrapper', () => { expect(createFlash).toHaveBeenCalledWith({ message: RESET_INTEGRATION_TOKEN_ERROR }); }); - it('shows an error alert when integration update fails ', async () => { + it('shows an error alert when integration update fails', async () => { jest.spyOn(wrapper.vm.$apollo, 'mutate').mockRejectedValue(errorMsg); findAlertsSettingsForm().vm.$emit('update-integration', {}); @@ -357,14 +357,14 @@ describe('AlertsSettingsWrapper', () => { mock.restore(); }); - it('shows an error alert when integration test payload is invalid ', async () => { + it('shows an error alert when integration test payload is invalid', async () => { mock.onPost(/(.*)/).replyOnce(httpStatusCodes.UNPROCESSABLE_ENTITY); await wrapper.vm.testAlertPayload({ endpoint: '', data: '', token: '' }); expect(createFlash).toHaveBeenCalledWith({ message: INTEGRATION_PAYLOAD_TEST_ERROR }); expect(createFlash).toHaveBeenCalledTimes(1); }); - it('shows an error alert when integration is not activated ', async () => { + it('shows an error alert when integration is not activated', async () => { mock.onPost(/(.*)/).replyOnce(httpStatusCodes.FORBIDDEN); await wrapper.vm.testAlertPayload({ endpoint: '', data: '', token: '' }); expect(createFlash).toHaveBeenCalledWith({ diff --git a/spec/frontend/behaviors/bind_in_out_spec.js b/spec/frontend/behaviors/bind_in_out_spec.js index 49425a9377e..4d958e30b4d 100644 --- a/spec/frontend/behaviors/bind_in_out_spec.js +++ b/spec/frontend/behaviors/bind_in_out_spec.js @@ -33,7 +33,7 @@ describe('BindInOut', () => { testContext.bindInOut = new BindInOut({ tagName: 'INPUT' }); }); - it('should set .eventType to keyup ', () => { + it('should set .eventType to keyup', () => { expect(testContext.bindInOut.eventType).toEqual('keyup'); }); }); @@ -43,7 +43,7 @@ describe('BindInOut', () => { testContext.bindInOut = new BindInOut({ tagName: 'TEXTAREA' }); }); - it('should set .eventType to keyup ', () => { + it('should set .eventType to keyup', () => { expect(testContext.bindInOut.eventType).toEqual('keyup'); }); }); @@ -53,7 +53,7 @@ describe('BindInOut', () => { testContext.bindInOut = new BindInOut({ tagName: 'SELECT' }); }); - it('should set .eventType to change ', () => { + it('should set .eventType to change', () => { expect(testContext.bindInOut.eventType).toEqual('change'); }); }); diff --git a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js index 914f2d78d3a..1ea4e4f833b 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js @@ -86,7 +86,7 @@ describe('Ci variable modal', () => { createComponent(); }); - it('shows the submit button as disabled ', () => { + it('shows the submit button as disabled', () => { expect(findAddorUpdateButton().attributes('disabled')).toBe('true'); }); }); @@ -96,7 +96,7 @@ describe('Ci variable modal', () => { createComponent({ props: { selectedVariable: mockVariables[0] } }); }); - it('shows the submit button as enabled ', () => { + it('shows the submit button as enabled', () => { expect(findAddorUpdateButton().attributes('disabled')).toBeUndefined(); }); }); diff --git a/spec/frontend/ci_variable_list/store/mutations_spec.js b/spec/frontend/ci_variable_list/store/mutations_spec.js index ae750ff426d..c7d07ead09b 100644 --- a/spec/frontend/ci_variable_list/store/mutations_spec.js +++ b/spec/frontend/ci_variable_list/store/mutations_spec.js @@ -36,7 +36,7 @@ describe('CI variable list mutations', () => { }); describe('CLEAR_MODAL', () => { - it('should clear modal state ', () => { + it('should clear modal state', () => { const modalState = { variable_type: 'Variable', key: '', diff --git a/spec/frontend/content_editor/components/toolbar_text_style_dropdown_spec.js b/spec/frontend/content_editor/components/toolbar_text_style_dropdown_spec.js index 608be1bd693..3ebb305afbf 100644 --- a/spec/frontend/content_editor/components/toolbar_text_style_dropdown_spec.js +++ b/spec/frontend/content_editor/components/toolbar_text_style_dropdown_spec.js @@ -53,7 +53,7 @@ describe('content_editor/components/toolbar_text_style_dropdown', () => { }); }); - describe('when there is an active item ', () => { + describe('when there is an active item', () => { let activeTextStyle; beforeEach(async () => { @@ -68,7 +68,7 @@ describe('content_editor/components/toolbar_text_style_dropdown', () => { await emitEditorEvent({ event: 'transaction', tiptapEditor }); }); - it('displays the active text style label as the dropdown toggle text ', () => { + it('displays the active text style label as the dropdown toggle text', () => { expect(findDropdown().props().text).toBe(activeTextStyle.label); }); diff --git a/spec/frontend/diffs/components/diff_gutter_avatars_spec.js b/spec/frontend/diffs/components/diff_gutter_avatars_spec.js index ee96b939ec6..f13988fc11f 100644 --- a/spec/frontend/diffs/components/diff_gutter_avatars_spec.js +++ b/spec/frontend/diffs/components/diff_gutter_avatars_spec.js @@ -44,7 +44,7 @@ describe('DiffGutterAvatars', () => { expect(wrapper.emitted().toggleLineDiscussions).toBeDefined(); }); - it('renders the proper title and aria-label ', () => { + it('renders the proper title and aria-label', () => { expect(findCollapseButton().attributes('title')).toBe(HIDE_COMMENTS); expect(findCollapseButton().attributes('aria-label')).toBe(HIDE_COMMENTS); }); diff --git a/spec/frontend/diffs/components/diff_view_spec.js b/spec/frontend/diffs/components/diff_view_spec.js index e7fa8a574cb..1dd4a2f6c23 100644 --- a/spec/frontend/diffs/components/diff_view_spec.js +++ b/spec/frontend/diffs/components/diff_view_spec.js @@ -56,7 +56,7 @@ describe('DiffView', () => { expect(wrapper.findComponent(DiffLine).exists()).toBe(false); }); - it('does render a diff-line component with the correct props when there is a finding & refactorCodeQualityInlineFindings flag is true ', async () => { + it('does render a diff-line component with the correct props when there is a finding & refactorCodeQualityInlineFindings flag is true', async () => { const wrapper = createWrapper(diffCodeQuality, { glFeatures: { refactorCodeQualityInlineFindings: true }, }); @@ -65,7 +65,7 @@ describe('DiffView', () => { expect(wrapper.findComponent(DiffLine).props('line')).toBe(diffCodeQuality.diffLines[2]); }); - it('does not render a diff-line component when there is a finding & refactorCodeQualityInlineFindings flag is false ', async () => { + it('does not render a diff-line component when there is a finding & refactorCodeQualityInlineFindings flag is false', async () => { const wrapper = createWrapper(diffCodeQuality, { glFeatures: { refactorCodeQualityInlineFindings: false }, }); diff --git a/spec/frontend/error_tracking/components/stacktrace_entry_spec.js b/spec/frontend/error_tracking/components/stacktrace_entry_spec.js index 693fcff50ca..0de4277b08a 100644 --- a/spec/frontend/error_tracking/components/stacktrace_entry_spec.js +++ b/spec/frontend/error_tracking/components/stacktrace_entry_spec.js @@ -62,7 +62,7 @@ describe('Stacktrace Entry', () => { ); }); - it('should render only lineNo:columnNO when there is no errorFn ', () => { + it('should render only lineNo:columnNO when there is no errorFn', () => { const extraInfo = { errorLine: 34, errorFn: null, errorColumn: 77 }; mountComponent({ expanded: false, lines: [], ...extraInfo }); const fileHeaderContent = trimText(findFileHeaderContent()); @@ -70,7 +70,7 @@ describe('Stacktrace Entry', () => { expect(fileHeaderContent).toContain(`${extraInfo.errorLine}:${extraInfo.errorColumn}`); }); - it('should render only lineNo when there is no errorColumn ', () => { + it('should render only lineNo when there is no errorColumn', () => { const extraInfo = { errorLine: 34, errorFn: 'errorFn', errorColumn: null }; mountComponent({ expanded: false, lines: [], ...extraInfo }); const fileHeaderContent = trimText(findFileHeaderContent()); diff --git a/spec/frontend/feature_flags/components/environments_dropdown_spec.js b/spec/frontend/feature_flags/components/environments_dropdown_spec.js index e8103df78bc..2b9710c9085 100644 --- a/spec/frontend/feature_flags/components/environments_dropdown_spec.js +++ b/spec/frontend/feature_flags/components/environments_dropdown_spec.js @@ -8,7 +8,7 @@ import EnvironmentsDropdown from '~/feature_flags/components/environments_dropdo import axios from '~/lib/utils/axios_utils'; import httpStatusCodes from '~/lib/utils/http_status'; -describe('Feature flags > Environments dropdown ', () => { +describe('Feature flags > Environments dropdown', () => { let wrapper; let mock; const results = ['production', 'staging']; diff --git a/spec/frontend/feature_flags/store/edit/actions_spec.js b/spec/frontend/feature_flags/store/edit/actions_spec.js index b6114cb0c9f..7132e83a940 100644 --- a/spec/frontend/feature_flags/store/edit/actions_spec.js +++ b/spec/frontend/feature_flags/store/edit/actions_spec.js @@ -40,7 +40,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('success', () => { - it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagSuccess ', () => { + it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagSuccess', () => { const featureFlag = { name: 'name', description: 'description', @@ -75,7 +75,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('error', () => { - it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError ', () => { + it('dispatches requestUpdateFeatureFlag and receiveUpdateFeatureFlagError', () => { mock.onPut(`${TEST_HOST}/endpoint.json`).replyOnce(500, { message: [] }); return testAction( @@ -154,7 +154,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('success', () => { - it('dispatches requestFeatureFlag and receiveFeatureFlagSuccess ', () => { + it('dispatches requestFeatureFlag and receiveFeatureFlagSuccess', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { id: 1 }); return testAction( @@ -176,7 +176,7 @@ describe('Feature flags Edit Module actions', () => { }); describe('error', () => { - it('dispatches requestFeatureFlag and receiveUpdateFeatureFlagError ', () => { + it('dispatches requestFeatureFlag and receiveUpdateFeatureFlagError', () => { mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); return testAction( diff --git a/spec/frontend/feature_flags/store/index/actions_spec.js b/spec/frontend/feature_flags/store/index/actions_spec.js index ce62c3b0473..96a7d868316 100644 --- a/spec/frontend/feature_flags/store/index/actions_spec.js +++ b/spec/frontend/feature_flags/store/index/actions_spec.js @@ -56,7 +56,7 @@ describe('Feature flags actions', () => { }); describe('success', () => { - it('dispatches requestFeatureFlags and receiveFeatureFlagsSuccess ', () => { + it('dispatches requestFeatureFlags and receiveFeatureFlagsSuccess', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, getRequestData, {}); return testAction( @@ -78,7 +78,7 @@ describe('Feature flags actions', () => { }); describe('error', () => { - it('dispatches requestFeatureFlags and receiveFeatureFlagsError ', () => { + it('dispatches requestFeatureFlags and receiveFeatureFlagsError', () => { mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); return testAction( @@ -153,7 +153,7 @@ describe('Feature flags actions', () => { }); describe('success', () => { - it('dispatches requestRotateInstanceId and receiveRotateInstanceIdSuccess ', () => { + it('dispatches requestRotateInstanceId and receiveRotateInstanceIdSuccess', () => { mock.onPost(`${TEST_HOST}/endpoint.json`).replyOnce(200, rotateData, {}); return testAction( @@ -175,7 +175,7 @@ describe('Feature flags actions', () => { }); describe('error', () => { - it('dispatches requestRotateInstanceId and receiveRotateInstanceIdError ', () => { + it('dispatches requestRotateInstanceId and receiveRotateInstanceIdError', () => { mock.onGet(`${TEST_HOST}/endpoint.json`, {}).replyOnce(500, {}); return testAction( diff --git a/spec/frontend/feature_flags/store/new/actions_spec.js b/spec/frontend/feature_flags/store/new/actions_spec.js index 1dcd2da1d93..dbe6669c868 100644 --- a/spec/frontend/feature_flags/store/new/actions_spec.js +++ b/spec/frontend/feature_flags/store/new/actions_spec.js @@ -33,7 +33,7 @@ describe('Feature flags New Module Actions', () => { }); describe('success', () => { - it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagSuccess ', () => { + it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagSuccess', () => { const actionParams = { name: 'name', description: 'description', @@ -68,7 +68,7 @@ describe('Feature flags New Module Actions', () => { }); describe('error', () => { - it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagError ', () => { + it('dispatches requestCreateFeatureFlag and receiveCreateFeatureFlagError', () => { const actionParams = { name: 'name', description: 'description', diff --git a/spec/frontend/frequent_items/utils_spec.js b/spec/frontend/frequent_items/utils_spec.js index 33c655a6ffd..8d4c89bd48f 100644 --- a/spec/frontend/frequent_items/utils_spec.js +++ b/spec/frontend/frequent_items/utils_spec.js @@ -10,25 +10,25 @@ import { mockProject, unsortedFrequentItems, sortedFrequentItems } from './mock_ describe('Frequent Items utils spec', () => { describe('isMobile', () => { - it('returns true when the screen is medium ', () => { + it('returns true when the screen is medium', () => { jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('md'); expect(isMobile()).toBe(true); }); - it('returns true when the screen is small ', () => { + it('returns true when the screen is small', () => { jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('sm'); expect(isMobile()).toBe(true); }); - it('returns true when the screen is extra-small ', () => { + it('returns true when the screen is extra-small', () => { jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('xs'); expect(isMobile()).toBe(true); }); - it('returns false when the screen is larger than medium ', () => { + it('returns false when the screen is larger than medium', () => { jest.spyOn(bp, 'getBreakpointSize').mockReturnValue('lg'); expect(isMobile()).toBe(false); diff --git a/spec/frontend/header_search/init_spec.js b/spec/frontend/header_search/init_spec.js index 580798a6155..40c1843d461 100644 --- a/spec/frontend/header_search/init_spec.js +++ b/spec/frontend/header_search/init_spec.js @@ -27,7 +27,7 @@ describe('Header Search EventListener', () => { expect(addEventListenerSpy).toHaveBeenCalledTimes(2); }); - it('removes event listener ', async () => { + it('removes event listener', async () => { const searchInputBox = document?.querySelector('#search'); const removeEventListenerSpy = jest.spyOn(searchInputBox, 'removeEventListener'); jest.mock('~/header_search', () => ({ initHeaderSearchApp: jest.fn() })); diff --git a/spec/frontend/ide/components/commit_sidebar/list_spec.js b/spec/frontend/ide/components/commit_sidebar/list_spec.js index 81c81fc0a9f..4406d14d990 100644 --- a/spec/frontend/ide/components/commit_sidebar/list_spec.js +++ b/spec/frontend/ide/components/commit_sidebar/list_spec.js @@ -40,7 +40,7 @@ describe('Multi-file editor commit sidebar list', () => { wrapper = mountComponent({ fileList: [] }); }); - it('renders no changes text ', () => { + it('renders no changes text', () => { expect(wrapper.text()).toContain('No changes'); }); }); diff --git a/spec/frontend/ide/stores/actions/file_spec.js b/spec/frontend/ide/stores/actions/file_spec.js index d1c31cd412b..38a54e569a9 100644 --- a/spec/frontend/ide/stores/actions/file_spec.js +++ b/spec/frontend/ide/stores/actions/file_spec.js @@ -78,7 +78,7 @@ describe('IDE store file actions', () => { }); }); - it('switches to the next available file before closing the current one ', () => { + it('switches to the next available file before closing the current one', () => { const f = file('newOpenFile'); store.state.openFiles.push(f); diff --git a/spec/frontend/import_entities/import_projects/store/getters_spec.js b/spec/frontend/import_entities/import_projects/store/getters_spec.js index 55826b20ca3..110b692b222 100644 --- a/spec/frontend/import_entities/import_projects/store/getters_spec.js +++ b/spec/frontend/import_entities/import_projects/store/getters_spec.js @@ -85,7 +85,7 @@ describe('import_projects store getters', () => { }); describe('hasImportableRepos', () => { - it('returns true if there are any importable projects ', () => { + it('returns true if there are any importable projects', () => { localState.repositories = [IMPORTABLE_REPO, IMPORTED_REPO, INCOMPATIBLE_REPO]; expect(hasImportableRepos(localState)).toBe(true); @@ -99,7 +99,7 @@ describe('import_projects store getters', () => { }); describe('importAllCount', () => { - it('returns count of available importable projects ', () => { + it('returns count of available importable projects', () => { localState.repositories = [ IMPORTABLE_REPO, IMPORTABLE_REPO, diff --git a/spec/frontend/jobs/components/artifacts_block_spec.js b/spec/frontend/jobs/components/job/artifacts_block_spec.js index 0c7c0a6c311..c75deb64d84 100644 --- a/spec/frontend/jobs/components/artifacts_block_spec.js +++ b/spec/frontend/jobs/components/job/artifacts_block_spec.js @@ -1,6 +1,6 @@ import { mount } from '@vue/test-utils'; import { trimText } from 'helpers/text_helper'; -import ArtifactsBlock from '~/jobs/components/artifacts_block.vue'; +import ArtifactsBlock from '~/jobs/components/job/sidebar/artifacts_block.vue'; import { getTimeago } from '~/lib/utils/datetime_utility'; describe('Artifacts block', () => { diff --git a/spec/frontend/jobs/components/commit_block_spec.js b/spec/frontend/jobs/components/job/commit_block_spec.js index 8a6d48cecb8..4fcc754c82c 100644 --- a/spec/frontend/jobs/components/commit_block_spec.js +++ b/spec/frontend/jobs/components/job/commit_block_spec.js @@ -1,6 +1,6 @@ import { shallowMount } from '@vue/test-utils'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import CommitBlock from '~/jobs/components/commit_block.vue'; +import CommitBlock from '~/jobs/components/job/sidebar/commit_block.vue'; import ClipboardButton from '~/vue_shared/components/clipboard_button.vue'; describe('Commit block', () => { diff --git a/spec/frontend/jobs/components/empty_state_spec.js b/spec/frontend/jobs/components/job/empty_state_spec.js index 9738fd14275..299b607ad78 100644 --- a/spec/frontend/jobs/components/empty_state_spec.js +++ b/spec/frontend/jobs/components/job/empty_state_spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import EmptyState from '~/jobs/components/empty_state.vue'; +import EmptyState from '~/jobs/components/job/empty_state.vue'; describe('Empty State', () => { let wrapper; diff --git a/spec/frontend/jobs/components/environments_block_spec.js b/spec/frontend/jobs/components/job/environments_block_spec.js index 5a2b6988224..134533e2af8 100644 --- a/spec/frontend/jobs/components/environments_block_spec.js +++ b/spec/frontend/jobs/components/job/environments_block_spec.js @@ -1,5 +1,5 @@ import { mount } from '@vue/test-utils'; -import EnvironmentsBlock from '~/jobs/components/environments_block.vue'; +import EnvironmentsBlock from '~/jobs/components/job/environments_block.vue'; const TEST_CLUSTER_NAME = 'test_cluster'; const TEST_CLUSTER_PATH = 'path/to/test_cluster'; diff --git a/spec/frontend/jobs/components/erased_block_spec.js b/spec/frontend/jobs/components/job/erased_block_spec.js index 7b44458c18b..c6aba01fa53 100644 --- a/spec/frontend/jobs/components/erased_block_spec.js +++ b/spec/frontend/jobs/components/job/erased_block_spec.js @@ -1,6 +1,6 @@ import { GlLink } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; -import ErasedBlock from '~/jobs/components/erased_block.vue'; +import ErasedBlock from '~/jobs/components/job/erased_block.vue'; import { getTimeago } from '~/lib/utils/datetime_utility'; describe('Erased block', () => { diff --git a/spec/frontend/jobs/components/job_app_spec.js b/spec/frontend/jobs/components/job/job_app_spec.js index d028b65f075..822528403cf 100644 --- a/spec/frontend/jobs/components/job_app_spec.js +++ b/spec/frontend/jobs/components/job/job_app_spec.js @@ -5,16 +5,16 @@ import MockAdapter from 'axios-mock-adapter'; import Vuex from 'vuex'; import delayedJobFixture from 'test_fixtures/jobs/delayed.json'; import { TEST_HOST } from 'helpers/test_constants'; -import EmptyState from '~/jobs/components/empty_state.vue'; -import EnvironmentsBlock from '~/jobs/components/environments_block.vue'; -import ErasedBlock from '~/jobs/components/erased_block.vue'; -import JobApp from '~/jobs/components/job_app.vue'; -import Sidebar from '~/jobs/components/sidebar.vue'; -import StuckBlock from '~/jobs/components/stuck_block.vue'; -import UnmetPrerequisitesBlock from '~/jobs/components/unmet_prerequisites_block.vue'; +import EmptyState from '~/jobs/components/job/empty_state.vue'; +import EnvironmentsBlock from '~/jobs/components/job/environments_block.vue'; +import ErasedBlock from '~/jobs/components/job/erased_block.vue'; +import JobApp from '~/jobs/components/job/job_app.vue'; +import Sidebar from '~/jobs/components/job/sidebar/sidebar.vue'; +import StuckBlock from '~/jobs/components/job/stuck_block.vue'; +import UnmetPrerequisitesBlock from '~/jobs/components/job/unmet_prerequisites_block.vue'; import createStore from '~/jobs/store'; import axios from '~/lib/utils/axios_utils'; -import job from '../mock_data'; +import job from '../../mock_data'; describe('Job App', () => { Vue.use(Vuex); diff --git a/spec/frontend/jobs/components/job_container_item_spec.js b/spec/frontend/jobs/components/job/job_container_item_spec.js index eb2b0184e5f..05c38dd74b7 100644 --- a/spec/frontend/jobs/components/job_container_item_spec.js +++ b/spec/frontend/jobs/components/job/job_container_item_spec.js @@ -2,9 +2,9 @@ import { GlIcon, GlLink } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; import delayedJobFixture from 'test_fixtures/jobs/delayed.json'; -import JobContainerItem from '~/jobs/components/job_container_item.vue'; +import JobContainerItem from '~/jobs/components/job/sidebar/job_container_item.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue'; -import job from '../mock_data'; +import job from '../../mock_data'; describe('JobContainerItem', () => { let wrapper; diff --git a/spec/frontend/jobs/components/job_log_controllers_spec.js b/spec/frontend/jobs/components/job/job_log_controllers_spec.js index aa85253a177..5e9a73b4387 100644 --- a/spec/frontend/jobs/components/job_log_controllers_spec.js +++ b/spec/frontend/jobs/components/job/job_log_controllers_spec.js @@ -1,10 +1,10 @@ import { GlSearchBoxByClick } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; -import JobLogControllers from '~/jobs/components/job_log_controllers.vue'; +import JobLogControllers from '~/jobs/components/job/job_log_controllers.vue'; import HelpPopover from '~/vue_shared/components/help_popover.vue'; import { backoffMockImplementation } from 'helpers/backoff_helper'; import * as commonUtils from '~/lib/utils/common_utils'; -import { mockJobLog } from '../mock_data'; +import { mockJobLog } from '../../mock_data'; const mockToastShow = jest.fn(); diff --git a/spec/frontend/jobs/components/job_retry_forward_deployment_modal_spec.js b/spec/frontend/jobs/components/job/job_retry_forward_deployment_modal_spec.js index fa6a3b5d350..d60043f33f7 100644 --- a/spec/frontend/jobs/components/job_retry_forward_deployment_modal_spec.js +++ b/spec/frontend/jobs/components/job/job_retry_forward_deployment_modal_spec.js @@ -1,9 +1,9 @@ import { GlLink, GlModal } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; -import JobRetryForwardDeploymentModal from '~/jobs/components/job_retry_forward_deployment_modal.vue'; +import JobRetryForwardDeploymentModal from '~/jobs/components/job/sidebar/job_retry_forward_deployment_modal.vue'; import { JOB_RETRY_FORWARD_DEPLOYMENT_MODAL } from '~/jobs/constants'; import createStore from '~/jobs/store'; -import job from '../mock_data'; +import job from '../../mock_data'; describe('Job Retry Forward Deployment Modal', () => { let store; diff --git a/spec/frontend/jobs/components/job_sidebar_details_container_spec.js b/spec/frontend/jobs/components/job/job_sidebar_details_container_spec.js index a398f998dff..4da17ed8366 100644 --- a/spec/frontend/jobs/components/job_sidebar_details_container_spec.js +++ b/spec/frontend/jobs/components/job/job_sidebar_details_container_spec.js @@ -1,9 +1,9 @@ import { shallowMount } from '@vue/test-utils'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import DetailRow from '~/jobs/components/sidebar_detail_row.vue'; -import SidebarJobDetailsContainer from '~/jobs/components/sidebar_job_details_container.vue'; +import DetailRow from '~/jobs/components/job/sidebar/sidebar_detail_row.vue'; +import SidebarJobDetailsContainer from '~/jobs/components/job/sidebar/sidebar_job_details_container.vue'; import createStore from '~/jobs/store'; -import job from '../mock_data'; +import job from '../../mock_data'; describe('Job Sidebar Details Container', () => { let store; diff --git a/spec/frontend/jobs/components/job_sidebar_retry_button_spec.js b/spec/frontend/jobs/components/job/job_sidebar_retry_button_spec.js index ad72b9be261..18d5f35bde4 100644 --- a/spec/frontend/jobs/components/job_sidebar_retry_button_spec.js +++ b/spec/frontend/jobs/components/job/job_sidebar_retry_button_spec.js @@ -1,7 +1,7 @@ import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; -import JobsSidebarRetryButton from '~/jobs/components/job_sidebar_retry_button.vue'; +import JobsSidebarRetryButton from '~/jobs/components/job/sidebar/job_sidebar_retry_button.vue'; import createStore from '~/jobs/store'; -import job from '../mock_data'; +import job from '../../mock_data'; describe('Job Sidebar Retry Button', () => { let store; diff --git a/spec/frontend/jobs/components/jobs_container_spec.js b/spec/frontend/jobs/components/job/jobs_container_spec.js index 127570b8184..2fde4d3020b 100644 --- a/spec/frontend/jobs/components/jobs_container_spec.js +++ b/spec/frontend/jobs/components/job/jobs_container_spec.js @@ -1,7 +1,7 @@ import { GlLink } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import JobsContainer from '~/jobs/components/jobs_container.vue'; +import JobsContainer from '~/jobs/components/job/sidebar/jobs_container.vue'; describe('Jobs List block', () => { let wrapper; diff --git a/spec/frontend/jobs/components/job/legacy_manual_variables_form_spec.js b/spec/frontend/jobs/components/job/legacy_manual_variables_form_spec.js new file mode 100644 index 00000000000..184562b2968 --- /dev/null +++ b/spec/frontend/jobs/components/job/legacy_manual_variables_form_spec.js @@ -0,0 +1,156 @@ +import { GlSprintf, GlLink } from '@gitlab/ui'; +import { mount } from '@vue/test-utils'; +import Vue, { nextTick } from 'vue'; +import Vuex from 'vuex'; +import { extendedWrapper } from 'helpers/vue_test_utils_helper'; +import LegacyManualVariablesForm from '~/jobs/components/job/legacy_manual_variables_form.vue'; + +Vue.use(Vuex); + +describe('Manual Variables Form', () => { + let wrapper; + let store; + + const requiredProps = { + action: { + path: '/play', + method: 'post', + button_title: 'Trigger this manual action', + }, + }; + + const createComponent = (props = {}) => { + store = new Vuex.Store({ + actions: { + triggerManualJob: jest.fn(), + }, + }); + + wrapper = extendedWrapper( + mount(LegacyManualVariablesForm, { + propsData: { ...requiredProps, ...props }, + store, + stubs: { + GlSprintf, + }, + }), + ); + }; + + const findHelpText = () => wrapper.findComponent(GlSprintf); + const findHelpLink = () => wrapper.findComponent(GlLink); + + const findTriggerBtn = () => wrapper.findByTestId('trigger-manual-job-btn'); + const findDeleteVarBtn = () => wrapper.findByTestId('delete-variable-btn'); + const findAllDeleteVarBtns = () => wrapper.findAllByTestId('delete-variable-btn'); + const findDeleteVarBtnPlaceholder = () => wrapper.findByTestId('delete-variable-btn-placeholder'); + const findCiVariableKey = () => wrapper.findByTestId('ci-variable-key'); + const findAllCiVariableKeys = () => wrapper.findAllByTestId('ci-variable-key'); + const findCiVariableValue = () => wrapper.findByTestId('ci-variable-value'); + const findAllVariables = () => wrapper.findAllByTestId('ci-variable-row'); + + const setCiVariableKey = () => { + findCiVariableKey().setValue('new key'); + findCiVariableKey().vm.$emit('change'); + nextTick(); + }; + + const setCiVariableKeyByPosition = (position, value) => { + findAllCiVariableKeys().at(position).setValue(value); + findAllCiVariableKeys().at(position).vm.$emit('change'); + nextTick(); + }; + + beforeEach(() => { + createComponent(); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + it('creates a new variable when user enters a new key value', async () => { + expect(findAllVariables()).toHaveLength(1); + + await setCiVariableKey(); + + expect(findAllVariables()).toHaveLength(2); + }); + + it('does not create extra empty variables', async () => { + expect(findAllVariables()).toHaveLength(1); + + await setCiVariableKey(); + + expect(findAllVariables()).toHaveLength(2); + + await setCiVariableKey(); + + expect(findAllVariables()).toHaveLength(2); + }); + + it('removes the correct variable row', async () => { + const variableKeyNameOne = 'key-one'; + const variableKeyNameThree = 'key-three'; + + await setCiVariableKeyByPosition(0, variableKeyNameOne); + + await setCiVariableKeyByPosition(1, 'key-two'); + + await setCiVariableKeyByPosition(2, variableKeyNameThree); + + expect(findAllVariables()).toHaveLength(4); + + await findAllDeleteVarBtns().at(1).trigger('click'); + + expect(findAllVariables()).toHaveLength(3); + + expect(findAllCiVariableKeys().at(0).element.value).toBe(variableKeyNameOne); + expect(findAllCiVariableKeys().at(1).element.value).toBe(variableKeyNameThree); + expect(findAllCiVariableKeys().at(2).element.value).toBe(''); + }); + + it('trigger button is disabled after trigger action', async () => { + expect(findTriggerBtn().props('disabled')).toBe(false); + + await findTriggerBtn().trigger('click'); + + expect(findTriggerBtn().props('disabled')).toBe(true); + }); + + it('delete variable button should only show when there is more than one variable', async () => { + expect(findDeleteVarBtn().exists()).toBe(false); + + await setCiVariableKey(); + + expect(findDeleteVarBtn().exists()).toBe(true); + }); + + it('delete variable button placeholder should only exist when a user cannot remove', async () => { + expect(findDeleteVarBtnPlaceholder().exists()).toBe(true); + }); + + it('renders help text with provided link', () => { + expect(findHelpText().exists()).toBe(true); + expect(findHelpLink().attributes('href')).toBe( + '/help/ci/variables/index#add-a-cicd-variable-to-a-project', + ); + }); + + it('passes variables in correct format', async () => { + jest.spyOn(store, 'dispatch'); + + await setCiVariableKey(); + + await findCiVariableValue().setValue('new value'); + + await findTriggerBtn().trigger('click'); + + expect(store.dispatch).toHaveBeenCalledWith('triggerManualJob', [ + { + key: 'new key', + secret_value: 'new value', + }, + ]); + }); +}); diff --git a/spec/frontend/jobs/components/job/legacy_sidebar_header_spec.js b/spec/frontend/jobs/components/job/legacy_sidebar_header_spec.js new file mode 100644 index 00000000000..cb32ca9d3dc --- /dev/null +++ b/spec/frontend/jobs/components/job/legacy_sidebar_header_spec.js @@ -0,0 +1,91 @@ +import { shallowMount } from '@vue/test-utils'; +import { extendedWrapper } from 'helpers/vue_test_utils_helper'; +import JobRetryButton from '~/jobs/components/job/sidebar/job_sidebar_retry_button.vue'; +import LegacySidebarHeader from '~/jobs/components/job/sidebar/legacy_sidebar_header.vue'; +import createStore from '~/jobs/store'; +import job from '../../mock_data'; + +describe('Legacy Sidebar Header', () => { + let store; + let wrapper; + + const findCancelButton = () => wrapper.findByTestId('cancel-button'); + const findRetryButton = () => wrapper.findComponent(JobRetryButton); + const findEraseLink = () => wrapper.findByTestId('job-log-erase-link'); + + const createWrapper = (props) => { + store = createStore(); + + wrapper = extendedWrapper( + shallowMount(LegacySidebarHeader, { + propsData: { + job, + ...props, + }, + store, + }), + ); + }; + + afterEach(() => { + wrapper.destroy(); + }); + + describe('when job log is erasable', () => { + const path = '/root/ci-project/-/jobs/1447/erase'; + + beforeEach(() => { + createWrapper({ + erasePath: path, + }); + }); + + it('renders erase job link', () => { + expect(findEraseLink().exists()).toBe(true); + }); + + it('erase job link has correct path', () => { + expect(findEraseLink().attributes('href')).toBe(path); + }); + }); + + describe('when job log is not erasable', () => { + beforeEach(() => { + createWrapper(); + }); + + it('does not render erase button', () => { + expect(findEraseLink().exists()).toBe(false); + }); + }); + + describe('when the job is retryable', () => { + beforeEach(() => { + createWrapper(); + }); + + it('should render the retry button', () => { + expect(findRetryButton().props('href')).toBe(job.retry_path); + }); + }); + + describe('when there is no retry path', () => { + it('should not render a retry button', async () => { + const copy = { ...job, retry_path: null }; + createWrapper({ job: copy }); + + expect(findRetryButton().exists()).toBe(false); + }); + }); + + describe('when the job is cancelable', () => { + beforeEach(() => { + createWrapper(); + }); + + it('should render link to cancel job', () => { + expect(findCancelButton().props('icon')).toBe('cancel'); + expect(findCancelButton().attributes('href')).toBe(job.cancel_path); + }); + }); +}); diff --git a/spec/frontend/jobs/components/manual_variables_form_spec.js b/spec/frontend/jobs/components/job/manual_variables_form_spec.js index 6faab3ddf31..5806f9f75f9 100644 --- a/spec/frontend/jobs/components/manual_variables_form_spec.js +++ b/spec/frontend/jobs/components/job/manual_variables_form_spec.js @@ -3,7 +3,7 @@ import { mount } from '@vue/test-utils'; import Vue, { nextTick } from 'vue'; import Vuex from 'vuex'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import ManualVariablesForm from '~/jobs/components/manual_variables_form.vue'; +import ManualVariablesForm from '~/jobs/components/job/manual_variables_form.vue'; Vue.use(Vuex); diff --git a/spec/frontend/jobs/components/sidebar_detail_row_spec.js b/spec/frontend/jobs/components/job/sidebar_detail_row_spec.js index 8d2680608ab..5c9c011b4ab 100644 --- a/spec/frontend/jobs/components/sidebar_detail_row_spec.js +++ b/spec/frontend/jobs/components/job/sidebar_detail_row_spec.js @@ -1,6 +1,6 @@ import { GlLink } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; -import SidebarDetailRow from '~/jobs/components/sidebar_detail_row.vue'; +import SidebarDetailRow from '~/jobs/components/job/sidebar/sidebar_detail_row.vue'; describe('Sidebar detail row', () => { let wrapper; diff --git a/spec/frontend/jobs/components/job/sidebar_header_spec.js b/spec/frontend/jobs/components/job/sidebar_header_spec.js new file mode 100644 index 00000000000..cb32ca9d3dc --- /dev/null +++ b/spec/frontend/jobs/components/job/sidebar_header_spec.js @@ -0,0 +1,91 @@ +import { shallowMount } from '@vue/test-utils'; +import { extendedWrapper } from 'helpers/vue_test_utils_helper'; +import JobRetryButton from '~/jobs/components/job/sidebar/job_sidebar_retry_button.vue'; +import LegacySidebarHeader from '~/jobs/components/job/sidebar/legacy_sidebar_header.vue'; +import createStore from '~/jobs/store'; +import job from '../../mock_data'; + +describe('Legacy Sidebar Header', () => { + let store; + let wrapper; + + const findCancelButton = () => wrapper.findByTestId('cancel-button'); + const findRetryButton = () => wrapper.findComponent(JobRetryButton); + const findEraseLink = () => wrapper.findByTestId('job-log-erase-link'); + + const createWrapper = (props) => { + store = createStore(); + + wrapper = extendedWrapper( + shallowMount(LegacySidebarHeader, { + propsData: { + job, + ...props, + }, + store, + }), + ); + }; + + afterEach(() => { + wrapper.destroy(); + }); + + describe('when job log is erasable', () => { + const path = '/root/ci-project/-/jobs/1447/erase'; + + beforeEach(() => { + createWrapper({ + erasePath: path, + }); + }); + + it('renders erase job link', () => { + expect(findEraseLink().exists()).toBe(true); + }); + + it('erase job link has correct path', () => { + expect(findEraseLink().attributes('href')).toBe(path); + }); + }); + + describe('when job log is not erasable', () => { + beforeEach(() => { + createWrapper(); + }); + + it('does not render erase button', () => { + expect(findEraseLink().exists()).toBe(false); + }); + }); + + describe('when the job is retryable', () => { + beforeEach(() => { + createWrapper(); + }); + + it('should render the retry button', () => { + expect(findRetryButton().props('href')).toBe(job.retry_path); + }); + }); + + describe('when there is no retry path', () => { + it('should not render a retry button', async () => { + const copy = { ...job, retry_path: null }; + createWrapper({ job: copy }); + + expect(findRetryButton().exists()).toBe(false); + }); + }); + + describe('when the job is cancelable', () => { + beforeEach(() => { + createWrapper(); + }); + + it('should render link to cancel job', () => { + expect(findCancelButton().props('icon')).toBe('cancel'); + expect(findCancelButton().attributes('href')).toBe(job.cancel_path); + }); + }); +}); diff --git a/spec/frontend/jobs/components/sidebar_spec.js b/spec/frontend/jobs/components/job/sidebar_spec.js index 9a4720bf97b..dc1aa67489d 100644 --- a/spec/frontend/jobs/components/sidebar_spec.js +++ b/spec/frontend/jobs/components/job/sidebar_spec.js @@ -1,14 +1,13 @@ import { shallowMount } from '@vue/test-utils'; import { nextTick } from 'vue'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import ArtifactsBlock from '~/jobs/components/artifacts_block.vue'; -import JobRetryForwardDeploymentModal from '~/jobs/components/job_retry_forward_deployment_modal.vue'; -import JobRetryButton from '~/jobs/components/job_sidebar_retry_button.vue'; -import JobsContainer from '~/jobs/components/jobs_container.vue'; -import Sidebar, { forwardDeploymentFailureModalId } from '~/jobs/components/sidebar.vue'; -import StagesDropdown from '~/jobs/components/stages_dropdown.vue'; +import ArtifactsBlock from '~/jobs/components/job/sidebar/artifacts_block.vue'; +import JobRetryForwardDeploymentModal from '~/jobs/components/job/sidebar/job_retry_forward_deployment_modal.vue'; +import JobsContainer from '~/jobs/components/job/sidebar/jobs_container.vue'; +import Sidebar from '~/jobs/components/job/sidebar/sidebar.vue'; +import StagesDropdown from '~/jobs/components/job/sidebar/stages_dropdown.vue'; import createStore from '~/jobs/store'; -import job, { jobsInStage } from '../mock_data'; +import job, { jobsInStage } from '../../mock_data'; describe('Sidebar details block', () => { let store; @@ -17,11 +16,8 @@ describe('Sidebar details block', () => { const forwardDeploymentFailure = 'forward_deployment_failure'; const findModal = () => wrapper.findComponent(JobRetryForwardDeploymentModal); const findArtifactsBlock = () => wrapper.findComponent(ArtifactsBlock); - const findCancelButton = () => wrapper.findByTestId('cancel-button'); const findNewIssueButton = () => wrapper.findByTestId('job-new-issue'); - const findRetryButton = () => wrapper.findComponent(JobRetryButton); const findTerminalLink = () => wrapper.findByTestId('terminal-link'); - const findEraseLink = () => wrapper.findByTestId('job-log-erase-link'); const createWrapper = (props) => { store = createStore(); @@ -43,44 +39,6 @@ describe('Sidebar details block', () => { wrapper.destroy(); }); - describe('when job log is erasable', () => { - const path = '/root/ci-project/-/jobs/1447/erase'; - - beforeEach(() => { - createWrapper({ - erasePath: path, - }); - }); - - it('renders erase job link', () => { - expect(findEraseLink().exists()).toBe(true); - }); - - it('erase job link has correct path', () => { - expect(findEraseLink().attributes('href')).toBe(path); - }); - }); - - describe('when job log is not erasable', () => { - beforeEach(() => { - createWrapper(); - }); - - it('does not render erase button', () => { - expect(findEraseLink().exists()).toBe(false); - }); - }); - - describe('when there is no retry path retry', () => { - it('should not render a retry button', async () => { - createWrapper(); - const copy = { ...job, retry_path: null }; - await store.dispatch('receiveJobSuccess', copy); - - expect(findRetryButton().exists()).toBe(false); - }); - }); - describe('without terminal path', () => { it('does not render terminal link', async () => { createWrapper(); @@ -109,15 +67,6 @@ describe('Sidebar details block', () => { expect(findNewIssueButton().attributes('href')).toBe(job.new_issue_path); expect(findNewIssueButton().text()).toBe('New issue'); }); - - it('should render the retry button', () => { - expect(findRetryButton().props('href')).toBe(job.retry_path); - }); - - it('should render link to cancel job', () => { - expect(findCancelButton().props('icon')).toBe('cancel'); - expect(findCancelButton().attributes('href')).toBe(job.cancel_path); - }); }); describe('forward deployment failure', () => { @@ -155,16 +104,6 @@ describe('Sidebar details block', () => { it('should render the modal', () => { expect(findModal().exists()).toBe(true); }); - - it('should provide the modal id to the button and modal', () => { - expect(findRetryButton().props('modalId')).toBe(forwardDeploymentFailureModalId); - expect(findModal().props('modalId')).toBe(forwardDeploymentFailureModalId); - }); - - it('should provide the retry path to the button and modal', () => { - expect(findRetryButton().props('href')).toBe(job.retry_path); - expect(findModal().props('href')).toBe(job.retry_path); - }); }); }); diff --git a/spec/frontend/jobs/components/stages_dropdown_spec.js b/spec/frontend/jobs/components/job/stages_dropdown_spec.js index f638213ef0c..61dec585e82 100644 --- a/spec/frontend/jobs/components/stages_dropdown_spec.js +++ b/spec/frontend/jobs/components/job/stages_dropdown_spec.js @@ -2,7 +2,7 @@ import { GlDropdown, GlDropdownItem, GlLink, GlSprintf } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; import Mousetrap from 'mousetrap'; import { extendedWrapper } from 'helpers/vue_test_utils_helper'; -import StagesDropdown from '~/jobs/components/stages_dropdown.vue'; +import StagesDropdown from '~/jobs/components/job/sidebar/stages_dropdown.vue'; import CiIcon from '~/vue_shared/components/ci_icon.vue'; import * as copyToClipboard from '~/behaviors/copy_to_clipboard'; import { @@ -10,7 +10,7 @@ import { mockPipelineWithoutMR, mockPipelineWithAttachedMR, mockPipelineDetached, -} from '../mock_data'; +} from '../../mock_data'; describe('Stages Dropdown', () => { let wrapper; diff --git a/spec/frontend/jobs/components/stuck_block_spec.js b/spec/frontend/jobs/components/job/stuck_block_spec.js index 119255cc1e9..8dc570cce27 100644 --- a/spec/frontend/jobs/components/stuck_block_spec.js +++ b/spec/frontend/jobs/components/job/stuck_block_spec.js @@ -1,6 +1,6 @@ import { GlBadge, GlLink } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; -import StuckBlock from '~/jobs/components/stuck_block.vue'; +import StuckBlock from '~/jobs/components/job/stuck_block.vue'; describe('Stuck Block Job component', () => { let wrapper; diff --git a/spec/frontend/jobs/components/trigger_block_spec.js b/spec/frontend/jobs/components/job/trigger_block_spec.js index 78596612d23..a1de8fd143f 100644 --- a/spec/frontend/jobs/components/trigger_block_spec.js +++ b/spec/frontend/jobs/components/job/trigger_block_spec.js @@ -1,6 +1,6 @@ import { GlButton, GlTableLite } from '@gitlab/ui'; import { mount } from '@vue/test-utils'; -import TriggerBlock from '~/jobs/components/trigger_block.vue'; +import TriggerBlock from '~/jobs/components/job/sidebar/trigger_block.vue'; describe('Trigger block', () => { let wrapper; diff --git a/spec/frontend/jobs/components/unmet_prerequisites_block_spec.js b/spec/frontend/jobs/components/job/unmet_prerequisites_block_spec.js index d1dbd65bd17..fb7d389c4d6 100644 --- a/spec/frontend/jobs/components/unmet_prerequisites_block_spec.js +++ b/spec/frontend/jobs/components/job/unmet_prerequisites_block_spec.js @@ -1,6 +1,6 @@ import { GlAlert, GlLink } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; -import UnmetPrerequisitesBlock from '~/jobs/components/unmet_prerequisites_block.vue'; +import UnmetPrerequisitesBlock from '~/jobs/components/job/unmet_prerequisites_block.vue'; describe('Unmet Prerequisites Block Job component', () => { let wrapper; diff --git a/spec/frontend/jobs/store/actions_spec.js b/spec/frontend/jobs/store/actions_spec.js index b9f97a3c3ae..0d11c4d56bf 100644 --- a/spec/frontend/jobs/store/actions_spec.js +++ b/spec/frontend/jobs/store/actions_spec.js @@ -111,7 +111,7 @@ describe('Job State actions', () => { }); describe('success', () => { - it('dispatches requestJob and receiveJobSuccess ', () => { + it('dispatches requestJob and receiveJobSuccess', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, { id: 121212, name: 'karma' }); return testAction( @@ -137,7 +137,7 @@ describe('Job State actions', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).reply(500); }); - it('dispatches requestJob and receiveJobError ', () => { + it('dispatches requestJob and receiveJobError', () => { return testAction( fetchJob, null, @@ -291,7 +291,7 @@ describe('Job State actions', () => { mock.onGet(`${TEST_HOST}/endpoint/trace.json`).reply(500); }); - it('dispatches requestJobLog and receiveJobLogError ', () => { + it('dispatches requestJobLog and receiveJobLogError', () => { return testAction( fetchJobLog, null, @@ -355,7 +355,7 @@ describe('Job State actions', () => { window.clearTimeout = origTimeout; }); - it('should commit STOP_POLLING_JOB_LOG mutation ', async () => { + it('should commit STOP_POLLING_JOB_LOG mutation', async () => { const jobLogTimeout = 7; await testAction( @@ -370,7 +370,7 @@ describe('Job State actions', () => { }); describe('receiveJobLogSuccess', () => { - it('should commit RECEIVE_JOB_LOG_SUCCESS mutation ', () => { + it('should commit RECEIVE_JOB_LOG_SUCCESS mutation', () => { return testAction( receiveJobLogSuccess, 'hello world', @@ -388,7 +388,7 @@ describe('Job State actions', () => { }); describe('toggleCollapsibleLine', () => { - it('should commit TOGGLE_COLLAPSIBLE_LINE mutation ', () => { + it('should commit TOGGLE_COLLAPSIBLE_LINE mutation', () => { return testAction( toggleCollapsibleLine, { isClosed: true }, @@ -400,7 +400,7 @@ describe('Job State actions', () => { }); describe('requestJobsForStage', () => { - it('should commit REQUEST_JOBS_FOR_STAGE mutation ', () => { + it('should commit REQUEST_JOBS_FOR_STAGE mutation', () => { return testAction( requestJobsForStage, { name: 'deploy' }, @@ -423,7 +423,7 @@ describe('Job State actions', () => { }); describe('success', () => { - it('dispatches requestJobsForStage and receiveJobsForStageSuccess ', () => { + it('dispatches requestJobsForStage and receiveJobsForStageSuccess', () => { mock .onGet(`${TEST_HOST}/jobs.json`) .replyOnce(200, { latest_statuses: [{ id: 121212, name: 'build' }], retried: [] }); @@ -473,7 +473,7 @@ describe('Job State actions', () => { }); describe('receiveJobsForStageSuccess', () => { - it('should commit RECEIVE_JOBS_FOR_STAGE_SUCCESS mutation ', () => { + it('should commit RECEIVE_JOBS_FOR_STAGE_SUCCESS mutation', () => { return testAction( receiveJobsForStageSuccess, [{ id: 121212, name: 'karma' }], @@ -485,7 +485,7 @@ describe('Job State actions', () => { }); describe('receiveJobsForStageError', () => { - it('should commit RECEIVE_JOBS_FOR_STAGE_ERROR mutation ', () => { + it('should commit RECEIVE_JOBS_FOR_STAGE_ERROR mutation', () => { return testAction( receiveJobsForStageError, null, diff --git a/spec/frontend/jobs/store/mutations_spec.js b/spec/frontend/jobs/store/mutations_spec.js index ea1ec383d6e..89cda3b0544 100644 --- a/spec/frontend/jobs/store/mutations_spec.js +++ b/spec/frontend/jobs/store/mutations_spec.js @@ -83,7 +83,7 @@ describe('Jobs Store Mutations', () => { describe('with new job log', () => { describe('log.lines', () => { describe('when append is true', () => { - it('sets the parsed log ', () => { + it('sets the parsed log', () => { mutations[types.RECEIVE_JOB_LOG_SUCCESS](stateCopy, { append: true, size: 511846, @@ -107,7 +107,7 @@ describe('Jobs Store Mutations', () => { }); describe('when it is defined', () => { - it('sets the parsed log ', () => { + it('sets the parsed log', () => { mutations[types.RECEIVE_JOB_LOG_SUCCESS](stateCopy, { append: false, size: 511846, diff --git a/spec/frontend/lib/dompurify_spec.js b/spec/frontend/lib/dompurify_spec.js index 29b927ef628..5523cc0606e 100644 --- a/spec/frontend/lib/dompurify_spec.js +++ b/spec/frontend/lib/dompurify_spec.js @@ -203,7 +203,7 @@ describe('~/lib/dompurify', () => { expect(el.getAttribute('rel')).toBe('noreferrer noopener'); }); - it('does not update `rel` values when target is not `_blank` ', () => { + it('does not update `rel` values when target is not `_blank`', () => { const html = `<a href="https://example.com" target="_self" rel="help">internal</a>`; const el = getSanitizedNode(html); diff --git a/spec/frontend/lib/utils/apollo_startup_js_link_spec.js b/spec/frontend/lib/utils/apollo_startup_js_link_spec.js index 06573f346e0..b972f669ac4 100644 --- a/spec/frontend/lib/utils/apollo_startup_js_link_spec.js +++ b/spec/frontend/lib/utils/apollo_startup_js_link_spec.js @@ -84,7 +84,7 @@ describe('StartupJSLink', () => { }); }); - describe('variable match errors: ', () => { + describe('variable match errors:', () => { it('forwards requests if the variables are not matching', () => { window.gl = { startup_graphql_calls: [ diff --git a/spec/frontend/lib/utils/common_utils_spec.js b/spec/frontend/lib/utils/common_utils_spec.js index a2ace8857ed..a0140d1d8a8 100644 --- a/spec/frontend/lib/utils/common_utils_spec.js +++ b/spec/frontend/lib/utils/common_utils_spec.js @@ -476,7 +476,7 @@ describe('common_utils', () => { }); }); - it('catches the rejected promise from the callback ', () => { + it('catches the rejected promise from the callback', () => { const errorMessage = 'Mistakes were made!'; return commonUtils .backOff((next, stop) => { diff --git a/spec/frontend/merge_conflicts/store/actions_spec.js b/spec/frontend/merge_conflicts/store/actions_spec.js index 7cee6576b53..e73769cba51 100644 --- a/spec/frontend/merge_conflicts/store/actions_spec.js +++ b/spec/frontend/merge_conflicts/store/actions_spec.js @@ -48,7 +48,7 @@ describe('merge conflicts actions', () => { ); }); - it('when data has type equal to error ', () => { + it('when data has type equal to error', () => { mock.onGet(conflictsPath).reply(200, { type: 'error', message: 'error message' }); return testAction( actions.fetchConflictsData, @@ -63,7 +63,7 @@ describe('merge conflicts actions', () => { ); }); - it('when request fails ', () => { + it('when request fails', () => { mock.onGet(conflictsPath).reply(400); return testAction( actions.fetchConflictsData, @@ -80,7 +80,7 @@ describe('merge conflicts actions', () => { }); describe('setConflictsData', () => { - it('INTERACTIVE_RESOLVE_MODE updates the correct file ', () => { + it('INTERACTIVE_RESOLVE_MODE updates the correct file', () => { decorateFiles.mockReturnValue([{ bar: 'baz' }]); return testAction( actions.setConflictsData, @@ -239,7 +239,7 @@ describe('merge conflicts actions', () => { }); describe('setFileResolveMode', () => { - it('INTERACTIVE_RESOLVE_MODE updates the correct file ', () => { + it('INTERACTIVE_RESOLVE_MODE updates the correct file', () => { return testAction( actions.setFileResolveMode, { file: files[0], mode: INTERACTIVE_RESOLVE_MODE }, @@ -257,7 +257,7 @@ describe('merge conflicts actions', () => { ); }); - it('EDIT_RESOLVE_MODE updates the correct file ', async () => { + it('EDIT_RESOLVE_MODE updates the correct file', async () => { restoreFileLinesState.mockReturnValue([]); const file = { ...files[0], @@ -286,7 +286,7 @@ describe('merge conflicts actions', () => { }); describe('setPromptConfirmationState', () => { - it('updates the correct file ', () => { + it('updates the correct file', () => { return testAction( actions.setPromptConfirmationState, { file: files[0], promptDiscardConfirmation: true }, @@ -315,7 +315,7 @@ describe('merge conflicts actions', () => { ], }; - it('updates the correct file ', async () => { + it('updates the correct file', async () => { const marLikeMockReturn = { foo: 'bar' }; markLine.mockReturnValue(marLikeMockReturn); diff --git a/spec/frontend/monitoring/components/charts/stacked_column_spec.js b/spec/frontend/monitoring/components/charts/stacked_column_spec.js index 91fe36bc6e4..779ded090c2 100644 --- a/spec/frontend/monitoring/components/charts/stacked_column_spec.js +++ b/spec/frontend/monitoring/components/charts/stacked_column_spec.js @@ -72,7 +72,7 @@ describe('Stacked column chart component', () => { ]); }); - it('chart options should configure data zoom and axis label ', () => { + it('chart options should configure data zoom and axis label', () => { const chartOptions = findChart().props('option'); const xAxisType = findChart().props('xAxisType'); diff --git a/spec/frontend/monitoring/store/actions_spec.js b/spec/frontend/monitoring/store/actions_spec.js index d1a13fbf9cd..a872a7780eb 100644 --- a/spec/frontend/monitoring/store/actions_spec.js +++ b/spec/frontend/monitoring/store/actions_spec.js @@ -855,7 +855,7 @@ describe('Monitoring store actions', () => { ); }); - it('dispatches receiveDashboardValidationWarningsSuccess with false payload when the response is empty ', () => { + it('dispatches receiveDashboardValidationWarningsSuccess with false payload when the response is empty', () => { mockMutate.mockResolvedValue({ data: { project: null, diff --git a/spec/frontend/notes/components/comment_form_spec.js b/spec/frontend/notes/components/comment_form_spec.js index 327f6d8341f..55e4ef42e37 100644 --- a/spec/frontend/notes/components/comment_form_spec.js +++ b/spec/frontend/notes/components/comment_form_spec.js @@ -679,7 +679,7 @@ describe('issue_comment_form component', () => { ); }); - it('clicking `add comment now`, should call note endpoint, set `isDraft` false ', () => { + it('clicking `add comment now`, should call note endpoint, set `isDraft` false', () => { mountComponent({ mountFunction: mount, initialData: { note: 'a comment' } }); jest.spyOn(store, 'dispatch').mockResolvedValue(); diff --git a/spec/frontend/notes/stores/mutation_spec.js b/spec/frontend/notes/stores/mutation_spec.js index e0a0fc43ffe..8809a496c52 100644 --- a/spec/frontend/notes/stores/mutation_spec.js +++ b/spec/frontend/notes/stores/mutation_spec.js @@ -74,7 +74,7 @@ describe('Notes Store mutations', () => { }); describe('DELETE_NOTE', () => { - it('should delete a note ', () => { + it('should delete a note', () => { const state = { discussions: [discussionMock] }; const toDelete = discussionMock.notes[0]; const lengthBefore = discussionMock.notes.length; diff --git a/spec/frontend/notifications/components/custom_notifications_modal_spec.js b/spec/frontend/notifications/components/custom_notifications_modal_spec.js index 9bde80e930f..cd04adac72d 100644 --- a/spec/frontend/notifications/components/custom_notifications_modal_spec.js +++ b/spec/frontend/notifications/components/custom_notifications_modal_spec.js @@ -197,7 +197,7 @@ describe('CustomNotificationsModal', () => { ${null} | ${1} | ${'/api/v4/groups/1/notification_settings'} | ${'group'} | ${'a groupId is given'} ${null} | ${null} | ${'/api/v4/notification_settings'} | ${'global'} | ${'neither projectId nor groupId are given'} `( - 'updates the $notificationType notification settings when $condition and the user clicks the checkbox ', + 'updates the $notificationType notification settings when $condition and the user clicks the checkbox', async ({ projectId, groupId, endpointUrl }) => { mockAxios .onGet(endpointUrl) diff --git a/spec/frontend/notifications/components/notifications_dropdown_spec.js b/spec/frontend/notifications/components/notifications_dropdown_spec.js index 8a6fd72fbeb..7a98b374095 100644 --- a/spec/frontend/notifications/components/notifications_dropdown_spec.js +++ b/spec/frontend/notifications/components/notifications_dropdown_spec.js @@ -244,7 +244,7 @@ describe('NotificationsDropdown', () => { expect(dropdownItem.props('isChecked')).toBe(true); }); - it("won't update the selectedNotificationLevel and shows a toast message when the request fails and ", async () => { + it("won't update the selectedNotificationLevel and shows a toast message when the request fails and", async () => { mockAxios.onPut('/api/v4/notification_settings').reply(httpStatus.NOT_FOUND, {}); wrapper = createComponent(); diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js index 9982286c625..b37edac83f7 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/details_header_spec.js @@ -120,7 +120,7 @@ describe('Details Header', () => { return waitForPromises(); }); - it('shows image.name ', () => { + it('shows image.name', () => { expect(findTitle().text()).toContain('foo'); }); @@ -289,7 +289,7 @@ describe('Details Header', () => { ); }); - describe('visibility and updated at ', () => { + describe('visibility and updated at', () => { it('has last updated text', async () => { mountComponent(); await waitForMetadataItems(); diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_loader_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_loader_spec.js index 3f5d4c3dbf7..88e79c513bc 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_loader_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_loader_spec.js @@ -25,7 +25,7 @@ describe('TagsLoader component', () => { wrapper = null; }); - it('produces the correct amount of loaders ', () => { + it('produces the correct amount of loaders', () => { mountComponent(); expect(findGlSkeletonLoaders().length).toBe(1); }); diff --git a/spec/frontend/packages_and_registries/harbor_registry/components/details/details_header_spec.js b/spec/frontend/packages_and_registries/harbor_registry/components/details/details_header_spec.js index 710aac4e22a..e8cc2b2e22d 100644 --- a/spec/frontend/packages_and_registries/harbor_registry/components/details/details_header_spec.js +++ b/spec/frontend/packages_and_registries/harbor_registry/components/details/details_header_spec.js @@ -30,7 +30,7 @@ describe('Harbor Details Header', () => { mountComponent({ propsData: { imagesDetail: { name: '', artifactCount: 1 } } }); }); - it('root image ', () => { + it('root image', () => { expect(findTitle().text()).toBe(ROOT_IMAGE_TEXT); }); }); @@ -40,7 +40,7 @@ describe('Harbor Details Header', () => { mountComponent({ propsData: { imagesDetail: { name: 'shao/flinkx', artifactCount: 1 } } }); }); - it('shows artifact.name ', () => { + it('shows artifact.name', () => { expect(findTitle().text()).toContain('shao/flinkx'); }); }); diff --git a/spec/frontend/packages_and_registries/package_registry/components/list/packages_list_spec.js b/spec/frontend/packages_and_registries/package_registry/components/list/packages_list_spec.js index 660f00a2b31..3e3607a361c 100644 --- a/spec/frontend/packages_and_registries/package_registry/components/list/packages_list_spec.js +++ b/spec/frontend/packages_and_registries/package_registry/components/list/packages_list_spec.js @@ -190,7 +190,7 @@ describe('packages_list', () => { }); }); - describe('pagination ', () => { + describe('pagination', () => { beforeEach(() => { mountComponent({ pageInfo: { hasPreviousPage: true } }); }); diff --git a/spec/frontend/packages_and_registries/settings/group/components/dependency_proxy_settings_spec.js b/spec/frontend/packages_and_registries/settings/group/components/dependency_proxy_settings_spec.js index 9d4c7f4737b..796d89231f4 100644 --- a/spec/frontend/packages_and_registries/settings/group/components/dependency_proxy_settings_spec.js +++ b/spec/frontend/packages_and_registries/settings/group/components/dependency_proxy_settings_spec.js @@ -169,7 +169,7 @@ describe('DependencyProxySettings', () => { toggleName | toggleFinder | localErrorMock | optimisticResponse ${'enable proxy'} | ${findEnableProxyToggle} | ${dependencyProxySettingMutationMock} | ${updateGroupDependencyProxySettingsOptimisticResponse} ${'enable ttl policies'} | ${findEnableTtlPoliciesToggle} | ${dependencyProxyUpdateTllPolicyMutationMock} | ${updateDependencyProxyImageTtlGroupPolicyOptimisticResponse} - `('$toggleName settings update ', ({ optimisticResponse, toggleFinder, localErrorMock }) => { + `('$toggleName settings update', ({ optimisticResponse, toggleFinder, localErrorMock }) => { describe('success state', () => { it('emits a success event', async () => { mountComponent(); diff --git a/spec/frontend/pages/admin/application_settings/metrics_and_profiling/usage_statistics_spec.js b/spec/frontend/pages/admin/application_settings/metrics_and_profiling/usage_statistics_spec.js index 3a52c243867..3c512cfd6ae 100644 --- a/spec/frontend/pages/admin/application_settings/metrics_and_profiling/usage_statistics_spec.js +++ b/spec/frontend/pages/admin/application_settings/metrics_and_profiling/usage_statistics_spec.js @@ -48,7 +48,7 @@ describe('UsageStatistics', () => { expectEnabledservicePingFeaturesCheckBox(); }); - it('is switched to disabled when Service Ping checkbox is unchecked ', () => { + it('is switched to disabled when Service Ping checkbox is unchecked', () => { servicePingCheckBox.click(); servicePingFeaturesCheckBox.click(); expectEnabledservicePingFeaturesCheckBox(); diff --git a/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js b/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js index 2f3e1b49b37..3b79739630d 100644 --- a/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js +++ b/spec/frontend/pipeline_editor/components/pipeline_editor_tabs_spec.js @@ -256,7 +256,7 @@ describe('Pipeline editor tabs component', () => { ${EDITOR_APP_STATUS_INVALID} | ${true} | ${false} | ${true} | ${false} ${EDITOR_APP_STATUS_VALID} | ${true} | ${true} | ${true} | ${true} `( - 'when status is $appStatus, we show - editor:$editor | viz:$viz | validate:$validate | merged:$merged ', + 'when status is $appStatus, we show - editor:$editor | viz:$viz | validate:$validate | merged:$merged', ({ appStatus, editor, viz, validate, merged }) => { createComponent({ appStatus }); diff --git a/spec/frontend/pipelines/graph/linked_pipeline_spec.js b/spec/frontend/pipelines/graph/linked_pipeline_spec.js index b9244ca0547..399d52c3dff 100644 --- a/spec/frontend/pipelines/graph/linked_pipeline_spec.js +++ b/spec/frontend/pipelines/graph/linked_pipeline_spec.js @@ -214,7 +214,7 @@ describe('Linked pipeline', () => { await findRetryButton().trigger('click'); }); - it('calls the retry mutation ', () => { + it('calls the retry mutation', () => { expect(wrapper.vm.$apollo.mutate).toHaveBeenCalledTimes(1); expect(wrapper.vm.$apollo.mutate).toHaveBeenCalledWith({ mutation: RetryPipelineMutation, @@ -255,7 +255,7 @@ describe('Linked pipeline', () => { createWrapper({ propsData: cancelablePipeline }); }); - it('shows only the cancel button ', () => { + it('shows only the cancel button', () => { expect(findCancelButton().exists()).toBe(true); expect(findRetryButton().exists()).toBe(false); }); @@ -375,7 +375,7 @@ describe('Linked pipeline', () => { ${'mouseover'} | ${'mouseout'} ${'focus'} | ${'blur'} `( - 'applies the class on $activateEventName and removes it on $deactivateEventName ', + 'applies the class on $activateEventName and removes it on $deactivateEventName', async ({ activateEventName, deactivateEventName }) => { const shadowClass = 'gl-shadow-none!'; diff --git a/spec/frontend/projects/commit/store/mutations_spec.js b/spec/frontend/projects/commit/store/mutations_spec.js index 60abf0fddad..40174b3057a 100644 --- a/spec/frontend/projects/commit/store/mutations_spec.js +++ b/spec/frontend/projects/commit/store/mutations_spec.js @@ -26,7 +26,7 @@ describe('Commit form modal mutations', () => { }); describe('CLEAR_MODAL', () => { - it('should clear modal state ', () => { + it('should clear modal state', () => { stateCopy = { branch: '_main_', defaultBranch: '_default_branch_' }; mutations[types.CLEAR_MODAL](stateCopy); diff --git a/spec/frontend/projects/settings/components/new_access_dropdown_spec.js b/spec/frontend/projects/settings/components/new_access_dropdown_spec.js index 1db48ce05d7..1b06f7874a3 100644 --- a/spec/frontend/projects/settings/components/new_access_dropdown_spec.js +++ b/spec/frontend/projects/settings/components/new_access_dropdown_spec.js @@ -134,7 +134,7 @@ describe('Access Level Dropdown', () => { await waitForPromises(); }); - it('renders headers for each section ', () => { + it('renders headers for each section', () => { expect(findAllDropdownHeaders()).toHaveLength(4); }); @@ -164,7 +164,7 @@ describe('Access Level Dropdown', () => { expect(findDropdown().props('toggleClass')).toBe('gl-text-gray-500!'); }); - it('when no items selected, displays a default fallback label and has default CSS class ', () => { + it('when no items selected, displays a default fallback label and has default CSS class', () => { expect(findDropdownToggleLabel()).toBe(i18n.selectUsers); expect(findDropdown().props('toggleClass')).toBe('gl-text-gray-500!'); }); @@ -217,7 +217,7 @@ describe('Access Level Dropdown', () => { }); describe('selecting an item', () => { - it('selects the item on click and deselects on the next click ', async () => { + it('selects the item on click and deselects on the next click', async () => { createComponent(); await waitForPromises(); @@ -230,7 +230,7 @@ describe('Access Level Dropdown', () => { expect(item.props('isChecked')).toBe(false); }); - it('emits a formatted update on selection ', async () => { + it('emits a formatted update on selection', async () => { // ids: the items appear in that order in the dropdown // 1 2 3 - roles // 4 5 6 - groups diff --git a/spec/frontend/reports/grouped_test_report/store/actions_spec.js b/spec/frontend/reports/grouped_test_report/store/actions_spec.js index 5876827c548..7469c31cf84 100644 --- a/spec/frontend/reports/grouped_test_report/store/actions_spec.js +++ b/spec/frontend/reports/grouped_test_report/store/actions_spec.js @@ -61,7 +61,7 @@ describe('Reports Store Actions', () => { }); describe('success', () => { - it('dispatches requestReports and receiveReportsSuccess ', () => { + it('dispatches requestReports and receiveReportsSuccess', () => { mock .onGet(`${TEST_HOST}/endpoint.json`) .replyOnce(200, { summary: {}, suites: [{ name: 'rspec' }] }); @@ -89,7 +89,7 @@ describe('Reports Store Actions', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).reply(500); }); - it('dispatches requestReports and receiveReportsError ', () => { + it('dispatches requestReports and receiveReportsError', () => { return testAction( fetchReports, null, diff --git a/spec/frontend/repository/components/delete_blob_modal_spec.js b/spec/frontend/repository/components/delete_blob_modal_spec.js index 785783b2e75..b5996816ad8 100644 --- a/spec/frontend/repository/components/delete_blob_modal_spec.js +++ b/spec/frontend/repository/components/delete_blob_modal_spec.js @@ -84,7 +84,7 @@ describe('DeleteBlobModal', () => { ${GlToggle} | ${'true'} | ${true} | ${initialProps.targetBranch} | ${initialProps.originalBranch} | ${true} ${GlToggle} | ${undefined} | ${true} | ${'same-branch'} | ${'same-branch'} | ${false} `( - 'has the correct form fields ', + 'has the correct form fields', ({ component, defaultValue, canPushCode, targetBranch, originalBranch, exist }) => { createComponent({ canPushCode, diff --git a/spec/frontend/repository/components/new_directory_modal_spec.js b/spec/frontend/repository/components/new_directory_modal_spec.js index e1c50d63851..aaf751a9a8d 100644 --- a/spec/frontend/repository/components/new_directory_modal_spec.js +++ b/spec/frontend/repository/components/new_directory_modal_spec.js @@ -107,7 +107,7 @@ describe('NewDirectoryModal', () => { ${findMrToggle} | ${'true'} | ${true} | ${'new-target-branch'} | ${'master'} | ${true} ${findMrToggle} | ${'true'} | ${true} | ${'master'} | ${'master'} | ${true} `( - 'has the correct form fields ', + 'has the correct form fields', ({ component, defaultValue, canPushCode, targetBranch, originalBranch, exist }) => { createComponent({ canPushCode, diff --git a/spec/frontend/repository/components/upload_blob_modal_spec.js b/spec/frontend/repository/components/upload_blob_modal_spec.js index bf024baa627..505ff7f3dd6 100644 --- a/spec/frontend/repository/components/upload_blob_modal_spec.js +++ b/spec/frontend/repository/components/upload_blob_modal_spec.js @@ -217,7 +217,7 @@ describe('UploadBlobModal', () => { createComponent(); }); - it('displays the default "Upload new file" modal title ', () => { + it('displays the default "Upload new file" modal title', () => { expect(findModal().props('title')).toBe('Upload new file'); }); diff --git a/spec/frontend/runner/admin_runner_show/admin_runner_show_app_spec.js b/spec/frontend/runner/admin_runner_show/admin_runner_show_app_spec.js index 509681c5a77..7ab4aeee9bc 100644 --- a/spec/frontend/runner/admin_runner_show/admin_runner_show_app_spec.js +++ b/spec/frontend/runner/admin_runner_show/admin_runner_show_app_spec.js @@ -164,7 +164,7 @@ describe('AdminRunnerShowApp', () => { }); }); - describe('when runner does not have an edit url ', () => { + describe('when runner does not have an edit url', () => { beforeEach(async () => { mockRunnerQueryResult({ editAdminUrl: null, diff --git a/spec/frontend/runner/components/cells/runner_stacked_summary_cell_spec.js b/spec/frontend/runner/components/cells/runner_stacked_summary_cell_spec.js index 958ce279a90..21ec9f61f37 100644 --- a/spec/frontend/runner/components/cells/runner_stacked_summary_cell_spec.js +++ b/spec/frontend/runner/components/cells/runner_stacked_summary_cell_spec.js @@ -117,7 +117,7 @@ describe('RunnerTypeCell', () => { expect(findRunnerSummaryField('pipeline').text()).toContain(`${mockRunner.jobCount}`); }); - it('Formats large job counts ', () => { + it('Formats large job counts', () => { createComponent({ jobCount: 1000, }); diff --git a/spec/frontend/sidebar/components/severity/sidebar_severity_spec.js b/spec/frontend/sidebar/components/severity/sidebar_severity_spec.js index 5d80a221d8e..83eb9a18597 100644 --- a/spec/frontend/sidebar/components/severity/sidebar_severity_spec.js +++ b/spec/frontend/sidebar/components/severity/sidebar_severity_spec.js @@ -97,7 +97,7 @@ describe('SidebarSeverity', () => { }); }); - it('shows error alert when severity update fails ', async () => { + it('shows error alert when severity update fails', async () => { const errorMsg = 'Something went wrong'; jest.spyOn(wrapper.vm.$apollo, 'mutate').mockRejectedValueOnce(errorMsg); findCriticalSeverityDropdownItem().vm.$emit('click'); diff --git a/spec/frontend/sidebar/lock/issuable_lock_form_spec.js b/spec/frontend/sidebar/lock/issuable_lock_form_spec.js index bb757fdf63b..986ccaea4b6 100644 --- a/spec/frontend/sidebar/lock/issuable_lock_form_spec.js +++ b/spec/frontend/sidebar/lock/issuable_lock_form_spec.js @@ -130,7 +130,7 @@ describe('IssuableLockForm', () => { expect(findEditForm().exists()).toBe(true); }); - it('tracks the event ', () => { + it('tracks the event', () => { const spy = mockTracking('_category_', wrapper.element, jest.spyOn); triggerEvent(findEditLink().element); diff --git a/spec/frontend/sidebar/sidebar_mediator_spec.js b/spec/frontend/sidebar/sidebar_mediator_spec.js index e32694abcce..355f0c45bbe 100644 --- a/spec/frontend/sidebar/sidebar_mediator_spec.js +++ b/spec/frontend/sidebar/sidebar_mediator_spec.js @@ -27,7 +27,7 @@ describe('Sidebar mediator', () => { mock.restore(); }); - it('assigns yourself ', () => { + it('assigns yourself', () => { mediator.assignYourself(); expect(mediator.store.currentUser).toEqual(mediatorMockData.currentUser); diff --git a/spec/frontend/token_access/mock_data.js b/spec/frontend/token_access/mock_data.js index 0f121fd1beb..6e2908e659f 100644 --- a/spec/frontend/token_access/mock_data.js +++ b/spec/frontend/token_access/mock_data.js @@ -24,19 +24,6 @@ export const disabledJobTokenScope = { }, }; -export const updateJobTokenScope = { - data: { - ciCdSettingsUpdate: { - ciCdSettings: { - jobTokenScopeEnabled: true, - __typename: 'ProjectCiCdSetting', - }, - errors: [], - __typename: 'CiCdSettingsUpdatePayload', - }, - }, -}; - export const projectsWithScope = { data: { project: { diff --git a/spec/frontend/token_access/token_access_spec.js b/spec/frontend/token_access/token_access_spec.js index 5aaeebd5af4..024e7dfff8c 100644 --- a/spec/frontend/token_access/token_access_spec.js +++ b/spec/frontend/token_access/token_access_spec.js @@ -8,13 +8,11 @@ import createFlash from '~/flash'; import TokenAccess from '~/token_access/components/token_access.vue'; import addProjectCIJobTokenScopeMutation from '~/token_access/graphql/mutations/add_project_ci_job_token_scope.mutation.graphql'; import removeProjectCIJobTokenScopeMutation from '~/token_access/graphql/mutations/remove_project_ci_job_token_scope.mutation.graphql'; -import updateCIJobTokenScopeMutation from '~/token_access/graphql/mutations/update_ci_job_token_scope.mutation.graphql'; import getCIJobTokenScopeQuery from '~/token_access/graphql/queries/get_ci_job_token_scope.query.graphql'; import getProjectsWithCIJobTokenScopeQuery from '~/token_access/graphql/queries/get_projects_with_ci_job_token_scope.query.graphql'; import { enabledJobTokenScope, disabledJobTokenScope, - updateJobTokenScope, projectsWithScope, addProjectSuccess, removeProjectSuccess, @@ -32,7 +30,6 @@ describe('TokenAccess component', () => { const enabledJobTokenScopeHandler = jest.fn().mockResolvedValue(enabledJobTokenScope); const disabledJobTokenScopeHandler = jest.fn().mockResolvedValue(disabledJobTokenScope); - const updateJobTokenScopeHandler = jest.fn().mockResolvedValue(updateJobTokenScope); const getProjectsWithScope = jest.fn().mockResolvedValue(projectsWithScope); const addProjectSuccessHandler = jest.fn().mockResolvedValue(addProjectSuccess); const addProjectFailureHandler = jest.fn().mockRejectedValue(error); @@ -95,7 +92,7 @@ describe('TokenAccess component', () => { expect(findTokenSection().exists()).toBe(true); }); - it('the toggle should be disabled and the token section should not show', async () => { + it('the toggle should be disabled and the token section should show', async () => { createComponent([ [getCIJobTokenScopeQuery, disabledJobTokenScopeHandler], [getProjectsWithCIJobTokenScopeQuery, getProjectsWithScope], @@ -104,28 +101,7 @@ describe('TokenAccess component', () => { await waitForPromises(); expect(findToggle().props('value')).toBe(false); - expect(findTokenSection().exists()).toBe(false); - }); - - it('switching the toggle calls the mutation and fetches the projects again', async () => { - createComponent([ - [getCIJobTokenScopeQuery, disabledJobTokenScopeHandler], - [updateCIJobTokenScopeMutation, updateJobTokenScopeHandler], - [getProjectsWithCIJobTokenScopeQuery, getProjectsWithScope], - ]); - - await waitForPromises(); - - expect(getProjectsWithScope).toHaveBeenCalledTimes(1); - - findToggle().vm.$emit('change', true); - - await waitForPromises(); - - expect(updateJobTokenScopeHandler).toHaveBeenCalledWith({ - input: { fullPath: projectPath, jobTokenScopeEnabled: true }, - }); - expect(getProjectsWithScope).toHaveBeenCalledTimes(2); + expect(findTokenSection().exists()).toBe(true); }); }); diff --git a/spec/frontend/user_lists/store/index/actions_spec.js b/spec/frontend/user_lists/store/index/actions_spec.js index 4a8d0afb963..7b2e29ae412 100644 --- a/spec/frontend/user_lists/store/index/actions_spec.js +++ b/spec/frontend/user_lists/store/index/actions_spec.js @@ -41,7 +41,7 @@ describe('~/user_lists/store/index/actions', () => { }); describe('success', () => { - it('dispatches requestUserLists and receiveUserListsSuccess ', () => { + it('dispatches requestUserLists and receiveUserListsSuccess', () => { return testAction( fetchUserLists, null, @@ -61,7 +61,7 @@ describe('~/user_lists/store/index/actions', () => { }); describe('error', () => { - it('dispatches requestUserLists and receiveUserListsError ', () => { + it('dispatches requestUserLists and receiveUserListsError', () => { Api.fetchFeatureFlagUserLists.mockRejectedValue(); return testAction( diff --git a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_failed_to_merge_spec.js b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_failed_to_merge_spec.js index 3a247eb0d7c..833fa27d453 100644 --- a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_failed_to_merge_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_failed_to_merge_spec.js @@ -40,7 +40,7 @@ describe('MRWidgetFailedToMerge', () => { expect(wrapper.vm.intervalId).toBe(dummyIntervalId); }); - it('clears interval when destroying ', () => { + it('clears interval when destroying', () => { createComponent(); wrapper.destroy(); diff --git a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js index bc3dbe8c351..9a6bf66909e 100644 --- a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_ready_to_merge_spec.js @@ -549,7 +549,7 @@ describe('ReadyToMerge', () => { ${'squashIsSelected'} | ${'selected'} | ${'value'} | ${false} ${'squashIsSelected'} | ${'unselected'} | ${'value'} | ${false} `( - 'is $state when squashIsReadonly returns $expectation ', + 'is $state when squashIsReadonly returns $expectation', ({ squashState, prop, expectation }) => { createComponent({ mr: { commitsCount: 2, enableSquashBeforeMerge: true, [squashState]: expectation }, diff --git a/spec/frontend/vue_merge_request_widget/deployment/deployment_actions_spec.js b/spec/frontend/vue_merge_request_widget/deployment/deployment_actions_spec.js index a285d26f404..a8912405fa8 100644 --- a/spec/frontend/vue_merge_request_widget/deployment/deployment_actions_spec.js +++ b/spec/frontend/vue_merge_request_widget/deployment/deployment_actions_spec.js @@ -189,7 +189,7 @@ describe('DeploymentAction component', () => { }); }); - describe('it should call the executeAction method ', () => { + describe('it should call the executeAction method', () => { beforeEach(async () => { jest.spyOn(wrapper.vm, 'executeAction').mockImplementation(); diff --git a/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js b/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js index 22562bb4ddb..1a109aad911 100644 --- a/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js +++ b/spec/frontend/vue_merge_request_widget/stores/artifacts_list/actions_spec.js @@ -60,7 +60,7 @@ describe('Artifacts App Store Actions', () => { }); describe('success', () => { - it('dispatches requestArtifacts and receiveArtifactsSuccess ', () => { + it('dispatches requestArtifacts and receiveArtifactsSuccess', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).replyOnce(200, [ { text: 'result.txt', @@ -103,7 +103,7 @@ describe('Artifacts App Store Actions', () => { mock.onGet(`${TEST_HOST}/endpoint.json`).reply(500); }); - it('dispatches requestArtifacts and receiveArtifactsError ', () => { + it('dispatches requestArtifacts and receiveArtifactsError', () => { return testAction( fetchArtifacts, null, diff --git a/spec/frontend/vue_shared/alert_details/alert_details_spec.js b/spec/frontend/vue_shared/alert_details/alert_details_spec.js index 59e21b2ff40..d309432bc63 100644 --- a/spec/frontend/vue_shared/alert_details/alert_details_spec.js +++ b/spec/frontend/vue_shared/alert_details/alert_details_spec.js @@ -248,7 +248,7 @@ describe('AlertDetails', () => { }); }); - it('shows error alert when incident creation fails ', async () => { + it('shows error alert when incident creation fails', async () => { const errorMsg = 'Something went wrong'; mountComponent({ mountMethod: mount, diff --git a/spec/frontend/vue_shared/alert_details/alert_metrics_spec.js b/spec/frontend/vue_shared/alert_details/alert_metrics_spec.js index cf04c1eb24a..9d84a535d67 100644 --- a/spec/frontend/vue_shared/alert_details/alert_metrics_spec.js +++ b/spec/frontend/vue_shared/alert_details/alert_metrics_spec.js @@ -42,7 +42,7 @@ describe('Alert Metrics', () => { }); describe('Empty state', () => { - it('should display a message when metrics dashboard url is not provided ', () => { + it('should display a message when metrics dashboard url is not provided', () => { mountComponent(); expect(findChart().exists()).toBe(false); expect(findEmptyState().text()).toBe("Metrics weren't available in the alerts payload."); diff --git a/spec/frontend/vue_shared/components/diff_stats_dropdown_spec.js b/spec/frontend/vue_shared/components/diff_stats_dropdown_spec.js index 04f63b4bd45..68684004b82 100644 --- a/spec/frontend/vue_shared/components/diff_stats_dropdown_spec.js +++ b/spec/frontend/vue_shared/components/diff_stats_dropdown_spec.js @@ -66,7 +66,7 @@ describe('Diff Stats Dropdown', () => { createComponent({ files: mockFiles }); }); - it('when no file name provided ', () => { + it('when no file name provided', () => { expect(findChangedFiles().at(0).text()).toContain(i18n.noFileNameAvailable); }); @@ -153,7 +153,7 @@ describe('Diff Stats Dropdown', () => { createComponent({ files: mockFiles }); }); - it('updates the URL ', () => { + it('updates the URL', () => { findChangedFiles().at(0).vm.$emit('click'); expect(window.location.hash).toBe(mockFiles[0].href); findChangedFiles().at(1).vm.$emit('click'); diff --git a/spec/frontend/vue_shared/components/registry/registry_search_spec.js b/spec/frontend/vue_shared/components/registry/registry_search_spec.js index 70f4693ae81..fa7fabfaef6 100644 --- a/spec/frontend/vue_shared/components/registry/registry_search_spec.js +++ b/spec/frontend/vue_shared/components/registry/registry_search_spec.js @@ -108,7 +108,7 @@ describe('Registry Search', () => { ]); }); - it('on sort item click emits sorting:changed event ', () => { + it('on sort item click emits sorting:changed event', () => { mountComponent(); findSortingItems().at(1).vm.$emit('click'); |