diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-19 15:09:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-19 15:09:51 +0300 |
commit | eef2437c0a359ec3437d31d1b1ea959e54c71458 (patch) | |
tree | 92ea24b2d26a057881171827e777604780838633 /spec/frontend/ci/runner | |
parent | 021a832cb8e90a0305452381ccf4ce15dc5e0ebd (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci/runner')
-rw-r--r-- | spec/frontend/ci/runner/components/runner_managers_table_spec.js | 7 | ||||
-rw-r--r-- | spec/frontend/ci/runner/components/runner_status_badge_spec.js | 20 |
2 files changed, 16 insertions, 11 deletions
diff --git a/spec/frontend/ci/runner/components/runner_managers_table_spec.js b/spec/frontend/ci/runner/components/runner_managers_table_spec.js index e72ea60cdbd..cde6ee6eea0 100644 --- a/spec/frontend/ci/runner/components/runner_managers_table_spec.js +++ b/spec/frontend/ci/runner/components/runner_managers_table_spec.js @@ -38,6 +38,7 @@ describe('RunnerJobs', () => { createComponent(); expect(findHeaders().wrappers.map((w) => w.text())).toEqual([ expect.stringContaining(s__('Runners|System ID')), + s__('Runners|Status'), s__('Runners|Version'), s__('Runners|IP Address'), s__('Runners|Executor'), @@ -57,6 +58,12 @@ describe('RunnerJobs', () => { expect(findCellText({ field: 'systemId', i: 1 })).toBe(mockItems[1].systemId); }); + it('shows status', () => { + createComponent(); + expect(findCellText({ field: 'status', i: 0 })).toBe(s__('Runners|Online')); + expect(findCellText({ field: 'status', i: 1 })).toBe(s__('Runners|Online')); + }); + it('shows version', () => { createComponent({ item: { version: '1.0' }, diff --git a/spec/frontend/ci/runner/components/runner_status_badge_spec.js b/spec/frontend/ci/runner/components/runner_status_badge_spec.js index e1eb81f2d23..781193d8afa 100644 --- a/spec/frontend/ci/runner/components/runner_status_badge_spec.js +++ b/spec/frontend/ci/runner/components/runner_status_badge_spec.js @@ -21,13 +21,11 @@ describe('RunnerTypeBadge', () => { const findBadge = () => wrapper.findComponent(GlBadge); const getTooltip = () => getBinding(findBadge().element, 'gl-tooltip'); - const createComponent = (props = {}) => { + const createComponent = ({ props = {} } = {}) => { wrapper = shallowMount(RunnerStatusBadge, { propsData: { - runner: { - contactedAt: '2020-12-31T23:59:00Z', - status: STATUS_ONLINE, - }, + contactedAt: '2020-12-31T23:59:00Z', + status: STATUS_ONLINE, ...props, }, directives: { @@ -55,7 +53,7 @@ describe('RunnerTypeBadge', () => { it('renders never contacted state', () => { createComponent({ - runner: { + props: { contactedAt: null, status: STATUS_NEVER_CONTACTED, }, @@ -68,7 +66,7 @@ describe('RunnerTypeBadge', () => { it('renders offline state', () => { createComponent({ - runner: { + props: { contactedAt: '2020-12-31T00:00:00Z', status: STATUS_OFFLINE, }, @@ -81,7 +79,7 @@ describe('RunnerTypeBadge', () => { it('renders stale state', () => { createComponent({ - runner: { + props: { contactedAt: '2020-01-01T00:00:00Z', status: STATUS_STALE, }, @@ -94,7 +92,7 @@ describe('RunnerTypeBadge', () => { it('renders stale state with no contact time', () => { createComponent({ - runner: { + props: { contactedAt: null, status: STATUS_STALE, }, @@ -108,7 +106,7 @@ describe('RunnerTypeBadge', () => { describe('does not fail when data is missing', () => { it('contacted_at is missing', () => { createComponent({ - runner: { + props: { contactedAt: null, status: STATUS_ONLINE, }, @@ -120,7 +118,7 @@ describe('RunnerTypeBadge', () => { it('status is missing', () => { createComponent({ - runner: { + props: { status: null, }, }); |