diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 00:13:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-11 00:13:10 +0300 |
commit | d9710d79c52bc73438022e79c79cfe3ab35b084b (patch) | |
tree | 4ccba377283753036ad28a75d061f7ee61afa806 /spec/frontend/ci/runner | |
parent | 20a86e7f6fd58882025b1c85b21e891d75220da5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci/runner')
5 files changed, 10 insertions, 31 deletions
diff --git a/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js b/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js index 6fc6c0b6085..c3d33c88422 100644 --- a/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js +++ b/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js @@ -60,8 +60,6 @@ import { mockRegistrationToken, newRunnerPath, emptyPageInfo, - emptyStateSvgPath, - emptyStateFilteredSvgPath, } from '../mock_data'; const mockRunners = allRunnersData.data.runners.nodes; @@ -122,8 +120,6 @@ describe('AdminRunnersApp', () => { localMutations, onlineContactTimeoutSecs, staleTimeoutSecs, - emptyStateSvgPath, - emptyStateFilteredSvgPath, ...provide, }, ...options, @@ -448,9 +444,7 @@ describe('AdminRunnersApp', () => { expect(findRunnerListEmptyState().props()).toEqual({ newRunnerPath, isSearchFiltered: false, - filteredSvgPath: emptyStateFilteredSvgPath, registrationToken: mockRegistrationToken, - svgPath: emptyStateSvgPath, }); }); diff --git a/spec/frontend/ci/runner/components/runner_jobs_empty_state_spec.js b/spec/frontend/ci/runner/components/runner_jobs_empty_state_spec.js index e64308f49d1..59c9383cb31 100644 --- a/spec/frontend/ci/runner/components/runner_jobs_empty_state_spec.js +++ b/spec/frontend/ci/runner/components/runner_jobs_empty_state_spec.js @@ -1,3 +1,5 @@ +import EMPTY_STATE_SVG_URL from '@gitlab/svgs/dist/illustrations/pipelines_empty.svg?url'; + import { shallowMount } from '@vue/test-utils'; import { GlEmptyState } from '@gitlab/ui'; import RunnerJobsEmptyState from '~/ci/runner/components/runner_jobs_empty_state.vue'; @@ -12,11 +14,7 @@ describe('RunnerJobsEmptyStateComponent', () => { let wrapper; const mountComponent = () => { - wrapper = shallowMount(RunnerJobsEmptyState, { - provide: { - emptyStateImage: 'emptyStateImage', - }, - }); + wrapper = shallowMount(RunnerJobsEmptyState); }; const findEmptyState = () => wrapper.findComponent(GlEmptyState); @@ -29,7 +27,7 @@ describe('RunnerJobsEmptyStateComponent', () => { it('should show an empty state if it is empty', () => { const emptyState = findEmptyState(); - expect(emptyState.props('svgPath')).toBe('emptyStateImage'); + expect(emptyState.props('svgPath')).toBe(EMPTY_STATE_SVG_URL); expect(emptyState.props('title')).toBe(DEFAULT_PROPS.emptyTitle); expect(emptyState.text()).toContain(DEFAULT_PROPS.emptyDescription); }); diff --git a/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js b/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js index f4e93e83ce8..0de2759ea8a 100644 --- a/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js +++ b/spec/frontend/ci/runner/components/runner_list_empty_state_spec.js @@ -1,15 +1,12 @@ +import EMPTY_STATE_SVG_URL from '@gitlab/svgs/dist/illustrations/pipelines_empty.svg?url'; +import FILTERED_SVG_URL from '@gitlab/svgs/dist/illustrations/magnifying-glass.svg?url'; import { GlEmptyState, GlLink, GlSprintf } from '@gitlab/ui'; import { s__ } from '~/locale'; import { shallowMountExtended } from 'helpers/vue_test_utils_helper'; import { createMockDirective, getBinding } from 'helpers/vue_mock_directive'; import RunnerInstructionsModal from '~/vue_shared/components/runner_instructions/runner_instructions_modal.vue'; -import { - mockRegistrationToken, - newRunnerPath, - emptyStateSvgPath, - emptyStateFilteredSvgPath, -} from 'jest/ci/runner/mock_data'; +import { mockRegistrationToken, newRunnerPath } from 'jest/ci/runner/mock_data'; import RunnerListEmptyState from '~/ci/runner/components/runner_list_empty_state.vue'; @@ -23,8 +20,6 @@ describe('RunnerListEmptyState', () => { const createComponent = ({ props, mountFn = shallowMountExtended, ...options } = {}) => { wrapper = mountFn(RunnerListEmptyState, { propsData: { - svgPath: emptyStateSvgPath, - filteredSvgPath: emptyStateFilteredSvgPath, registrationToken: mockRegistrationToken, newRunnerPath, ...props, @@ -50,7 +45,7 @@ describe('RunnerListEmptyState', () => { }); it('renders an illustration', () => { - expect(findEmptyState().props('svgPath')).toBe(emptyStateSvgPath); + expect(findEmptyState().props('svgPath')).toBe(EMPTY_STATE_SVG_URL); }); it('displays "no results" text with instructions', () => { @@ -125,7 +120,7 @@ describe('RunnerListEmptyState', () => { }); it('renders an illustration', () => { - expect(findEmptyState().props('svgPath')).toBe(emptyStateSvgPath); + expect(findEmptyState().props('svgPath')).toBe(EMPTY_STATE_SVG_URL); }); it('displays "no results" text', () => { @@ -148,7 +143,7 @@ describe('RunnerListEmptyState', () => { }); it('renders a "filtered search" illustration', () => { - expect(findEmptyState().props('svgPath')).toBe(emptyStateFilteredSvgPath); + expect(findEmptyState().props('svgPath')).toBe(FILTERED_SVG_URL); }); it('displays "no filtered results" text', () => { diff --git a/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js b/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js index e750327294c..41be72b1645 100644 --- a/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js +++ b/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js @@ -61,8 +61,6 @@ import { mockRegistrationToken, newRunnerPath, emptyPageInfo, - emptyStateSvgPath, - emptyStateFilteredSvgPath, } from '../mock_data'; Vue.use(VueApollo); @@ -123,8 +121,6 @@ describe('GroupRunnersApp', () => { localMutations, onlineContactTimeoutSecs, staleTimeoutSecs, - emptyStateSvgPath, - emptyStateFilteredSvgPath, ...provide, }, ...options, @@ -424,8 +420,6 @@ describe('GroupRunnersApp', () => { isSearchFiltered: false, newRunnerPath, registrationToken: mockRegistrationToken, - svgPath: 'emptyStateSvgPath.svg', - filteredSvgPath: 'emptyStateFilteredSvgPath.svg', }); }); }); diff --git a/spec/frontend/ci/runner/mock_data.js b/spec/frontend/ci/runner/mock_data.js index d47a95f5c07..223a156795c 100644 --- a/spec/frontend/ci/runner/mock_data.js +++ b/spec/frontend/ci/runner/mock_data.js @@ -322,8 +322,6 @@ export const mockRegistrationToken = 'MOCK_REGISTRATION_TOKEN'; export const mockAuthenticationToken = 'MOCK_AUTHENTICATION_TOKEN'; export const newRunnerPath = '/runners/new'; -export const emptyStateSvgPath = 'emptyStateSvgPath.svg'; -export const emptyStateFilteredSvgPath = 'emptyStateFilteredSvgPath.svg'; export { allRunnersData, |