diff options
Diffstat (limited to 'spec/frontend/ci/runner/components/cells/runner_status_cell_spec.js')
-rw-r--r-- | spec/frontend/ci/runner/components/cells/runner_status_cell_spec.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/frontend/ci/runner/components/cells/runner_status_cell_spec.js b/spec/frontend/ci/runner/components/cells/runner_status_cell_spec.js index 2fb824a8fa5..1ff60ff1a9d 100644 --- a/spec/frontend/ci/runner/components/cells/runner_status_cell_spec.js +++ b/spec/frontend/ci/runner/components/cells/runner_status_cell_spec.js @@ -10,6 +10,7 @@ import { INSTANCE_TYPE, STATUS_ONLINE, STATUS_OFFLINE, + JOB_STATUS_IDLE, } from '~/ci/runner/constants'; describe('RunnerStatusCell', () => { @@ -18,16 +19,18 @@ describe('RunnerStatusCell', () => { const findStatusBadge = () => wrapper.findComponent(RunnerStatusBadge); const findPausedBadge = () => wrapper.findComponent(RunnerPausedBadge); - const createComponent = ({ runner = {} } = {}) => { + const createComponent = ({ runner = {}, ...options } = {}) => { wrapper = mount(RunnerStatusCell, { propsData: { runner: { runnerType: INSTANCE_TYPE, active: true, status: STATUS_ONLINE, + jobExecutionStatus: JOB_STATUS_IDLE, ...runner, }, }, + ...options, }); }; @@ -74,4 +77,14 @@ describe('RunnerStatusCell', () => { expect(wrapper.text()).toBe(''); }); + + it('Displays "runner-job-status-badge" slot', () => { + createComponent({ + scopedSlots: { + 'runner-job-status-badge': ({ runner }) => `Job status ${runner.jobExecutionStatus}`, + }, + }); + + expect(wrapper.text()).toContain(`Job status ${JOB_STATUS_IDLE}`); + }); }); |