Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/ci_variable_list')
-rw-r--r--spec/frontend/ci_variable_list/components/ci_enviroments_dropdown_spec.js8
-rw-r--r--spec/frontend/ci_variable_list/components/ci_variable_modal_spec.js26
-rw-r--r--spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js4
-rw-r--r--spec/frontend/ci_variable_list/store/actions_spec.js4
4 files changed, 21 insertions, 21 deletions
diff --git a/spec/frontend/ci_variable_list/components/ci_enviroments_dropdown_spec.js b/spec/frontend/ci_variable_list/components/ci_enviroments_dropdown_spec.js
index a52b38599f7..7785d436834 100644
--- a/spec/frontend/ci_variable_list/components/ci_enviroments_dropdown_spec.js
+++ b/spec/frontend/ci_variable_list/components/ci_enviroments_dropdown_spec.js
@@ -1,7 +1,7 @@
import Vuex from 'vuex';
-import CiEnvironmentsDropdown from '~/ci_variable_list/components/ci_environments_dropdown.vue';
import { shallowMount, createLocalVue } from '@vue/test-utils';
-import { GlDropdownItem, GlIcon } from '@gitlab/ui';
+import { GlDeprecatedDropdownItem, GlIcon } from '@gitlab/ui';
+import CiEnvironmentsDropdown from '~/ci_variable_list/components/ci_environments_dropdown.vue';
const localVue = createLocalVue();
localVue.use(Vuex);
@@ -26,8 +26,8 @@ describe('Ci environments dropdown', () => {
});
};
- const findAllDropdownItems = () => wrapper.findAll(GlDropdownItem);
- const findDropdownItemByIndex = index => wrapper.findAll(GlDropdownItem).at(index);
+ const findAllDropdownItems = () => wrapper.findAll(GlDeprecatedDropdownItem);
+ const findDropdownItemByIndex = index => wrapper.findAll(GlDeprecatedDropdownItem).at(index);
const findActiveIconByIndex = index => wrapper.findAll(GlIcon).at(index);
afterEach(() => {
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();
});
});
});
diff --git a/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js b/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js
index 46f77a6f11e..5d37f059161 100644
--- a/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js
+++ b/spec/frontend/ci_variable_list/components/ci_variable_popover_spec.js
@@ -1,5 +1,5 @@
import { shallowMount } from '@vue/test-utils';
-import { GlDeprecatedButton } from '@gitlab/ui';
+import { GlButton } from '@gitlab/ui';
import CiVariablePopover from '~/ci_variable_list/components/ci_variable_popover.vue';
import mockData from '../services/mock_data';
@@ -18,7 +18,7 @@ describe('Ci Variable Popover', () => {
});
};
- const findButton = () => wrapper.find(GlDeprecatedButton);
+ const findButton = () => wrapper.find(GlButton);
beforeEach(() => {
createComponent();
diff --git a/spec/frontend/ci_variable_list/store/actions_spec.js b/spec/frontend/ci_variable_list/store/actions_spec.js
index eb565d4c979..4b89e467df0 100644
--- a/spec/frontend/ci_variable_list/store/actions_spec.js
+++ b/spec/frontend/ci_variable_list/store/actions_spec.js
@@ -1,8 +1,8 @@
-import Api from '~/api';
import MockAdapter from 'axios-mock-adapter';
import testAction from 'helpers/vuex_action_helper';
+import Api from '~/api';
import axios from '~/lib/utils/axios_utils';
-import createFlash from '~/flash';
+import { deprecatedCreateFlash as createFlash } from '~/flash';
import getInitialState from '~/ci_variable_list/store/state';
import * as actions from '~/ci_variable_list/store/actions';
import * as types from '~/ci_variable_list/store/mutation_types';