diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 18:42:06 +0000 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) | |
download | gitlab-ce-6e4e1050d9dba2b7b2523fdd1768823ab85feef4.tar.gz |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
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 | 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(); }); }); }); |