diff options
Diffstat (limited to 'spec/frontend/runner/components/cells')
-rw-r--r-- | spec/frontend/runner/components/cells/runner_actions_cell_spec.js | 22 | ||||
-rw-r--r-- | spec/frontend/runner/components/cells/runner_summary_cell_spec.js | 6 |
2 files changed, 26 insertions, 2 deletions
diff --git a/spec/frontend/runner/components/cells/runner_actions_cell_spec.js b/spec/frontend/runner/components/cells/runner_actions_cell_spec.js index 0d579106860..7a949cb6505 100644 --- a/spec/frontend/runner/components/cells/runner_actions_cell_spec.js +++ b/spec/frontend/runner/components/cells/runner_actions_cell_spec.js @@ -92,6 +92,24 @@ describe('RunnerActionsCell', () => { expect(findDeleteBtn().props('compact')).toBe(true); }); + it('Passes runner data to delete button', () => { + createComponent({ + runner: mockRunner, + }); + + expect(findDeleteBtn().props('runner')).toEqual(mockRunner); + }); + + it('Emits toggledPaused events', () => { + createComponent(); + + expect(wrapper.emitted('toggledPaused')).toBe(undefined); + + findRunnerPauseBtn().vm.$emit('toggledPaused'); + + expect(wrapper.emitted('toggledPaused')).toHaveLength(1); + }); + it('Emits delete events', () => { const value = { name: 'Runner' }; @@ -104,7 +122,7 @@ describe('RunnerActionsCell', () => { expect(wrapper.emitted('deleted')).toEqual([[value]]); }); - it('Does not render the runner delete button when user cannot delete', () => { + it('Renders the runner delete disabled button when user cannot delete', () => { createComponent({ runner: { userPermissions: { @@ -114,7 +132,7 @@ describe('RunnerActionsCell', () => { }, }); - expect(findDeleteBtn().exists()).toBe(false); + expect(findDeleteBtn().props('disabled')).toBe(true); }); }); }); diff --git a/spec/frontend/runner/components/cells/runner_summary_cell_spec.js b/spec/frontend/runner/components/cells/runner_summary_cell_spec.js index b6d957d27ea..b2e8c5a3ad9 100644 --- a/spec/frontend/runner/components/cells/runner_summary_cell_spec.js +++ b/spec/frontend/runner/components/cells/runner_summary_cell_spec.js @@ -5,6 +5,7 @@ import { INSTANCE_TYPE, PROJECT_TYPE } from '~/runner/constants'; const mockId = '1'; const mockShortSha = '2P6oDVDm'; const mockDescription = 'runner-1'; +const mockIpAddress = '0.0.0.0'; describe('RunnerTypeCell', () => { let wrapper; @@ -18,6 +19,7 @@ describe('RunnerTypeCell', () => { id: `gid://gitlab/Ci::Runner/${mockId}`, shortSha: mockShortSha, description: mockDescription, + ipAddress: mockIpAddress, runnerType: INSTANCE_TYPE, ...runner, }, @@ -59,6 +61,10 @@ describe('RunnerTypeCell', () => { expect(wrapper.text()).toContain(mockDescription); }); + it('Displays the runner ip address', () => { + expect(wrapper.text()).toContain(mockIpAddress); + }); + it('Displays a custom slot', () => { const slotContent = 'My custom runner summary'; |