diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-13 21:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-13 21:10:36 +0300 |
commit | c787c1559e9e558b83e78354823eb54b9fe8c718 (patch) | |
tree | 7e358b80fa7acb74db275ff6043f55f52a87738d /spec/frontend/ci_variable_list | |
parent | 6df7943512ca90323c69b926404cc561b6305ce2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci_variable_list')
-rw-r--r-- | spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js | 26 |
1 files changed, 13 insertions, 13 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 ad398d6ccd6..4e35243f484 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 @@ -1,6 +1,6 @@ import Vuex from 'vuex'; import { createLocalVue, shallowMount, mount } from '@vue/test-utils'; -import { GlDeprecatedButton, GlFormCombobox } from '@gitlab/ui'; +import { GlButton, GlFormCombobox } from '@gitlab/ui'; import { AWS_ACCESS_KEY_ID } from '~/ci_variable_list/constants'; import CiVariableModal from '~/ci_variable_list/components/ci_variable_modal.vue'; import createStore from '~/ci_variable_list/store'; @@ -29,14 +29,14 @@ describe('Ci variable modal', () => { }; const findModal = () => wrapper.find(ModalStub); - const addOrUpdateButton = index => + const findAddorUpdateButton = () => findModal() - .findAll(GlDeprecatedButton) - .at(index); + .findAll(GlButton) + .wrappers.find(button => button.props('variant') === 'success'); const deleteVariableButton = () => findModal() - .findAll(GlDeprecatedButton) - .at(1); + .findAll(GlButton) + .wrappers.find(button => button.props('variant') === 'danger'); afterEach(() => { wrapper.destroy(); @@ -69,7 +69,7 @@ describe('Ci variable modal', () => { }); it('button is disabled when no key/value pair are present', () => { - expect(addOrUpdateButton(1).attributes('disabled')).toBeTruthy(); + expect(findAddorUpdateButton().attributes('disabled')).toBeTruthy(); }); }); @@ -82,11 +82,11 @@ describe('Ci variable modal', () => { }); it('button is enabled when key/value pair are present', () => { - expect(addOrUpdateButton(1).attributes('disabled')).toBeFalsy(); + expect(findAddorUpdateButton().attributes('disabled')).toBeFalsy(); }); it('Add variable button dispatches addVariable action', () => { - addOrUpdateButton(1).vm.$emit('click'); + findAddorUpdateButton().vm.$emit('click'); expect(store.dispatch).toHaveBeenCalledWith('addVariable'); }); @@ -152,11 +152,11 @@ describe('Ci variable modal', () => { }); it('button text is Update variable when updating', () => { - expect(addOrUpdateButton(2).text()).toBe('Update variable'); + expect(findAddorUpdateButton().text()).toBe('Update variable'); }); it('Update variable button dispatches updateVariable with correct variable', () => { - addOrUpdateButton(2).vm.$emit('click'); + findAddorUpdateButton().vm.$emit('click'); expect(store.dispatch).toHaveBeenCalledWith('updateVariable'); }); @@ -189,7 +189,7 @@ describe('Ci variable modal', () => { }); it('disables the submit button', () => { - expect(addOrUpdateButton(1).attributes('disabled')).toBeTruthy(); + expect(findAddorUpdateButton().attributes('disabled')).toBeTruthy(); }); it('shows the correct error text', () => { @@ -213,7 +213,7 @@ describe('Ci variable modal', () => { }); it('does not disable the submit button', () => { - expect(addOrUpdateButton(1).attributes('disabled')).toBeFalsy(); + expect(findAddorUpdateButton().attributes('disabled')).toBeFalsy(); }); }); }); |