diff options
Diffstat (limited to 'spec/frontend/runner/components/runner_update_form_spec.js')
-rw-r--r-- | spec/frontend/runner/components/runner_update_form_spec.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/frontend/runner/components/runner_update_form_spec.js b/spec/frontend/runner/components/runner_update_form_spec.js index 3037364d941..7b67a89f989 100644 --- a/spec/frontend/runner/components/runner_update_form_spec.js +++ b/spec/frontend/runner/components/runner_update_form_spec.js @@ -1,6 +1,7 @@ import Vue, { nextTick } from 'vue'; import { GlForm, GlSkeletonLoader } from '@gitlab/ui'; import VueApollo from 'vue-apollo'; +import { __ } from '~/locale'; import createMockApollo from 'helpers/mock_apollo_helper'; import { mountExtended } from 'helpers/vue_test_utils_helper'; import waitForPromises from 'helpers/wait_for_promises'; @@ -47,6 +48,7 @@ describe('RunnerUpdateForm', () => { const findSubmit = () => wrapper.find('[type="submit"]'); const findSubmitDisabledAttr = () => findSubmit().attributes('disabled'); + const findCancelBtn = () => wrapper.findByRole('link', { name: __('Cancel') }); const submitForm = () => findForm().trigger('submit'); const submitFormAndWait = () => submitForm().then(waitForPromises); @@ -117,6 +119,11 @@ describe('RunnerUpdateForm', () => { expect(mockRunner).toMatchObject(getFieldsModel()); }); + it('Form shows a cancel button', () => { + expect(runnerUpdateHandler).not.toHaveBeenCalled(); + expect(findCancelBtn().attributes('href')).toBe(mockRunnerPath); + }); + it('Form prevent multiple submissions', async () => { await submitForm(); |