diff options
Diffstat (limited to 'spec/frontend/ci_variable_list/ci_variable_list/native_form_variable_list_spec.js')
-rw-r--r-- | spec/frontend/ci_variable_list/ci_variable_list/native_form_variable_list_spec.js | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/spec/frontend/ci_variable_list/ci_variable_list/native_form_variable_list_spec.js b/spec/frontend/ci_variable_list/ci_variable_list/native_form_variable_list_spec.js deleted file mode 100644 index 57f666e29d6..00000000000 --- a/spec/frontend/ci_variable_list/ci_variable_list/native_form_variable_list_spec.js +++ /dev/null @@ -1,40 +0,0 @@ -import $ from 'jquery'; -import { loadHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; -import setupNativeFormVariableList from '~/ci_variable_list/native_form_variable_list'; - -describe('NativeFormVariableList', () => { - let $wrapper; - - beforeEach(() => { - loadHTMLFixture('pipeline_schedules/edit.html'); - $wrapper = $('.js-ci-variable-list-section'); - - setupNativeFormVariableList({ - container: $wrapper, - formField: 'schedule', - }); - }); - - afterEach(() => { - resetHTMLFixture(); - }); - - describe('onFormSubmit', () => { - it('should clear out the `name` attribute on the inputs for the last empty row on form submission (avoid BE validation)', () => { - const $row = $wrapper.find('.js-row'); - - expect($row.find('.js-ci-variable-input-key').attr('name')).toBe( - 'schedule[variables_attributes][][key]', - ); - - expect($row.find('.js-ci-variable-input-value').attr('name')).toBe( - 'schedule[variables_attributes][][secret_value]', - ); - - $wrapper.closest('form').trigger('trigger-submit'); - - expect($row.find('.js-ci-variable-input-key').attr('name')).toBe(''); - expect($row.find('.js-ci-variable-input-value').attr('name')).toBe(''); - }); - }); -}); |