diff options
Diffstat (limited to 'spec/frontend/ci/pipeline_schedules/components/pipeline_schedules_form_spec.js')
-rw-r--r-- | spec/frontend/ci/pipeline_schedules/components/pipeline_schedules_form_spec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/ci/pipeline_schedules/components/pipeline_schedules_form_spec.js b/spec/frontend/ci/pipeline_schedules/components/pipeline_schedules_form_spec.js index 79a0cfa0dc9..33cf24c9ed1 100644 --- a/spec/frontend/ci/pipeline_schedules/components/pipeline_schedules_form_spec.js +++ b/spec/frontend/ci/pipeline_schedules/components/pipeline_schedules_form_spec.js @@ -97,6 +97,7 @@ describe('Pipeline schedules form', () => { const findLoadingIcon = () => wrapper.findComponent(GlLoadingIcon); // Variables const findVariableRows = () => wrapper.findAllByTestId('ci-variable-row'); + const findVariableTypes = () => wrapper.findAllByTestId('pipeline-form-ci-variable-type'); const findKeyInputs = () => wrapper.findAllByTestId('pipeline-form-ci-variable-key'); const findValueInputs = () => wrapper.findAllByTestId('pipeline-form-ci-variable-value'); const findHiddenValueInputs = () => @@ -182,6 +183,16 @@ describe('Pipeline schedules form', () => { mock.restore(); }); + it('changes variable type', async () => { + expect(findVariableTypes().at(0).props('selected')).toBe('ENV_VAR'); + + findVariableTypes().at(0).vm.$emit('select', 'FILE'); + + await nextTick(); + + expect(findVariableTypes().at(0).props('selected')).toBe('FILE'); + }); + it('creates blank variable on input change event', async () => { expect(findVariableRows()).toHaveLength(1); |