diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 18:09:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-13 18:09:21 +0300 |
commit | c36152ff8c41fad2f413f253eb7ac5c927e47c56 (patch) | |
tree | bbf300da207de3e8bbf272d44111ceedb18f5833 /spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js | |
parent | 286fe61013674fe2d245ffc8d2233baf09923e70 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js')
-rw-r--r-- | spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js index be2c017cc7e..8db6626fca3 100644 --- a/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js +++ b/spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js @@ -35,10 +35,6 @@ describe('Ci variable modal', () => { expect(findModal().props('actionPrimary').attributes.disabled).toBeTruthy(); }); - it('masked checkbox is disabled when value does not meet regex requirements', () => { - expect(wrapper.find({ ref: 'masked-ci-variable' }).attributes('disabled')).toBeTruthy(); - }); - describe('Adding a new variable', () => { beforeEach(() => { const [variable] = mockData.mockVariables; @@ -49,13 +45,6 @@ describe('Ci variable modal', () => { expect(findModal().props('actionPrimary').attributes.disabled).toBeFalsy(); }); - it('masked checkbox is enabled when value meets regex requirements', () => { - store.state.maskableRegex = '^[a-zA-Z0-9_+=/@:-]{8,}$'; - return wrapper.vm.$nextTick(() => { - expect(wrapper.find({ ref: 'masked-ci-variable' }).attributes('disabled')).toBeFalsy(); - }); - }); - it('Add variable button dispatches addVariable action', () => { findModal().vm.$emit('ok'); expect(store.dispatch).toHaveBeenCalledWith('addVariable'); @@ -74,7 +63,7 @@ describe('Ci variable modal', () => { }); it('button text is Update variable when updating', () => { - expect(wrapper.vm.modalActionText).toBe('Update Variable'); + expect(wrapper.vm.modalActionText).toBe('Update variable'); }); it('Update variable button dispatches updateVariable with correct variable', () => { @@ -89,5 +78,10 @@ describe('Ci variable modal', () => { findModal().vm.$emit('hidden'); expect(store.dispatch).toHaveBeenCalledWith('resetEditing'); }); + + it('dispatches deleteVariable with correct variable to delete', () => { + findModal().vm.$emit('secondary'); + expect(store.dispatch).toHaveBeenCalledWith('deleteVariable', mockData.mockVariables[0]); + }); }); }); |