diff options
Diffstat (limited to 'spec/frontend/ci/admin/jobs_table/components/cells/runner_cell_spec.js')
-rw-r--r-- | spec/frontend/ci/admin/jobs_table/components/cells/runner_cell_spec.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/frontend/ci/admin/jobs_table/components/cells/runner_cell_spec.js b/spec/frontend/ci/admin/jobs_table/components/cells/runner_cell_spec.js index 2f1dae71572..c9758c5ab24 100644 --- a/spec/frontend/ci/admin/jobs_table/components/cells/runner_cell_spec.js +++ b/spec/frontend/ci/admin/jobs_table/components/cells/runner_cell_spec.js @@ -1,5 +1,6 @@ import { GlLink } from '@gitlab/ui'; import { shallowMount } from '@vue/test-utils'; +import RunnerTypeIcon from '~/ci/runner/components/runner_type_icon.vue'; import RunnerCell from '~/ci/admin/jobs_table/components/cells/runner_cell.vue'; import { RUNNER_EMPTY_TEXT } from '~/ci/admin/jobs_table/constants'; import { allRunnersData } from 'jest/ci/runner/mock_data'; @@ -61,4 +62,29 @@ describe('Runner Cell', () => { }); }); }); + + describe('Runner Type Icon', () => { + const findRunnerTypeIcon = () => wrapper.findComponent(RunnerTypeIcon); + + describe('Job with runner', () => { + beforeEach(() => { + createComponent({ job: mockJobWithRunner }); + }); + + it('shows the runner type icon', () => { + expect(findRunnerTypeIcon().exists()).toBe(true); + expect(findRunnerTypeIcon().props('type')).toBe(mockJobWithRunner.runner.runnerType); + }); + }); + + describe('Job without runner', () => { + beforeEach(() => { + createComponent({ job: mockJobWithoutRunner }); + }); + + it('does not show the runner type icon', () => { + expect(findRunnerTypeIcon().exists()).toBe(false); + }); + }); + }); }); |