summaryrefslogtreecommitdiff
path: root/spec/frontend/ci_variable_list/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-10-20 09:40:42 +0000
commitee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch)
treef8479f94a28f66654c6a4f6fb99bad6b4e86a40e /spec/frontend/ci_variable_list/components
parent62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff)
downloadgitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'spec/frontend/ci_variable_list/components')
-rw-r--r--spec/frontend/ci_variable_list/components/ci_admin_variables_spec.js16
-rw-r--r--spec/frontend/ci_variable_list/components/ci_group_variables_spec.js16
-rw-r--r--spec/frontend/ci_variable_list/components/ci_project_variables_spec.js20
-rw-r--r--spec/frontend/ci_variable_list/components/legacy_ci_variable_settings_spec.js14
4 files changed, 33 insertions, 33 deletions
diff --git a/spec/frontend/ci_variable_list/components/ci_admin_variables_spec.js b/spec/frontend/ci_variable_list/components/ci_admin_variables_spec.js
index 920ceaefb70..864041141b8 100644
--- a/spec/frontend/ci_variable_list/components/ci_admin_variables_spec.js
+++ b/spec/frontend/ci_variable_list/components/ci_admin_variables_spec.js
@@ -4,8 +4,8 @@ import { GlLoadingIcon, GlTable } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
-import createFlash from '~/flash';
-import { resolvers } from '~/ci_variable_list/graphql/resolvers';
+import { createAlert } from '~/flash';
+import { resolvers } from '~/ci_variable_list/graphql/settings';
import ciAdminVariables from '~/ci_variable_list/components/ci_admin_variables.vue';
import ciVariableSettings from '~/ci_variable_list/components/ci_variable_settings.vue';
@@ -92,8 +92,8 @@ describe('Ci Admin Variable list', () => {
);
});
- it('createFlash was not called', () => {
- expect(createFlash).not.toHaveBeenCalled();
+ it('createAlert was not called', () => {
+ expect(createAlert).not.toHaveBeenCalled();
});
});
@@ -104,8 +104,8 @@ describe('Ci Admin Variable list', () => {
await createComponentWithApollo();
});
- it('calls createFlash with the expected error message', () => {
- expect(createFlash).toHaveBeenCalledWith({ message: variableFetchErrorText });
+ it('calls createAlert with the expected error message', () => {
+ expect(createAlert).toHaveBeenCalledWith({ message: variableFetchErrorText });
});
});
});
@@ -153,7 +153,7 @@ describe('Ci Admin Variable list', () => {
await nextTick();
expect(wrapper.vm.$apollo.mutate).toHaveBeenCalled();
- expect(createFlash).toHaveBeenCalledWith({ message: graphQLErrorMessage });
+ expect(createAlert).toHaveBeenCalledWith({ message: graphQLErrorMessage });
},
);
@@ -171,7 +171,7 @@ describe('Ci Admin Variable list', () => {
await findCiSettings().vm.$emit(event, newVariable);
expect(wrapper.vm.$apollo.mutate).toHaveBeenCalled();
- expect(createFlash).toHaveBeenCalledWith({ message: genericMutationErrorText });
+ expect(createAlert).toHaveBeenCalledWith({ message: genericMutationErrorText });
},
);
});
diff --git a/spec/frontend/ci_variable_list/components/ci_group_variables_spec.js b/spec/frontend/ci_variable_list/components/ci_group_variables_spec.js
index e45656acfd8..8a48e73eb9f 100644
--- a/spec/frontend/ci_variable_list/components/ci_group_variables_spec.js
+++ b/spec/frontend/ci_variable_list/components/ci_group_variables_spec.js
@@ -4,8 +4,8 @@ import { GlLoadingIcon, GlTable } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
-import createFlash from '~/flash';
-import { resolvers } from '~/ci_variable_list/graphql/resolvers';
+import { createAlert } from '~/flash';
+import { resolvers } from '~/ci_variable_list/graphql/settings';
import { convertToGraphQLId } from '~/graphql_shared/utils';
import ciGroupVariables from '~/ci_variable_list/components/ci_group_variables.vue';
@@ -95,8 +95,8 @@ describe('Ci Group Variable list', () => {
);
});
- it('createFlash was not called', () => {
- expect(createFlash).not.toHaveBeenCalled();
+ it('createAlert was not called', () => {
+ expect(createAlert).not.toHaveBeenCalled();
});
});
@@ -107,8 +107,8 @@ describe('Ci Group Variable list', () => {
await createComponentWithApollo();
});
- it('calls createFlash with the expected error message', () => {
- expect(createFlash).toHaveBeenCalledWith({ message: variableFetchErrorText });
+ it('calls createAlert with the expected error message', () => {
+ expect(createAlert).toHaveBeenCalledWith({ message: variableFetchErrorText });
});
});
});
@@ -158,7 +158,7 @@ describe('Ci Group Variable list', () => {
await nextTick();
expect(wrapper.vm.$apollo.mutate).toHaveBeenCalled();
- expect(createFlash).toHaveBeenCalledWith({ message: graphQLErrorMessage });
+ expect(createAlert).toHaveBeenCalledWith({ message: graphQLErrorMessage });
},
);
@@ -176,7 +176,7 @@ describe('Ci Group Variable list', () => {
await findCiSettings().vm.$emit(event, newVariable);
expect(wrapper.vm.$apollo.mutate).toHaveBeenCalled();
- expect(createFlash).toHaveBeenCalledWith({ message: genericMutationErrorText });
+ expect(createAlert).toHaveBeenCalledWith({ message: genericMutationErrorText });
},
);
});
diff --git a/spec/frontend/ci_variable_list/components/ci_project_variables_spec.js b/spec/frontend/ci_variable_list/components/ci_project_variables_spec.js
index 867f8e0cf8f..c630278fbde 100644
--- a/spec/frontend/ci_variable_list/components/ci_project_variables_spec.js
+++ b/spec/frontend/ci_variable_list/components/ci_project_variables_spec.js
@@ -4,8 +4,8 @@ import { GlLoadingIcon, GlTable } from '@gitlab/ui';
import { shallowMount } from '@vue/test-utils';
import createMockApollo from 'helpers/mock_apollo_helper';
import waitForPromises from 'helpers/wait_for_promises';
-import createFlash from '~/flash';
-import { resolvers } from '~/ci_variable_list/graphql/resolvers';
+import { createAlert } from '~/flash';
+import { resolvers } from '~/ci_variable_list/graphql/settings';
import { convertToGraphQLId } from '~/graphql_shared/utils';
import ciProjectVariables from '~/ci_variable_list/components/ci_project_variables.vue';
@@ -112,8 +112,8 @@ describe('Ci Project Variable list', () => {
);
});
- it('createFlash was not called', () => {
- expect(createFlash).not.toHaveBeenCalled();
+ it('createAlert was not called', () => {
+ expect(createAlert).not.toHaveBeenCalled();
});
});
@@ -125,8 +125,8 @@ describe('Ci Project Variable list', () => {
await createComponentWithApollo();
});
- it('calls createFlash with the expected error message', () => {
- expect(createFlash).toHaveBeenCalledWith({ message: variableFetchErrorText });
+ it('calls createAlert with the expected error message', () => {
+ expect(createAlert).toHaveBeenCalledWith({ message: variableFetchErrorText });
});
});
@@ -138,8 +138,8 @@ describe('Ci Project Variable list', () => {
await createComponentWithApollo();
});
- it('calls createFlash with the expected error message', () => {
- expect(createFlash).toHaveBeenCalledWith({ message: environmentFetchErrorText });
+ it('calls createAlert with the expected error message', () => {
+ expect(createAlert).toHaveBeenCalledWith({ message: environmentFetchErrorText });
});
});
});
@@ -190,7 +190,7 @@ describe('Ci Project Variable list', () => {
await nextTick();
expect(wrapper.vm.$apollo.mutate).toHaveBeenCalled();
- expect(createFlash).toHaveBeenCalledWith({ message: graphQLErrorMessage });
+ expect(createAlert).toHaveBeenCalledWith({ message: graphQLErrorMessage });
},
);
@@ -208,7 +208,7 @@ describe('Ci Project Variable list', () => {
await findCiSettings().vm.$emit(event, newVariable);
expect(wrapper.vm.$apollo.mutate).toHaveBeenCalled();
- expect(createFlash).toHaveBeenCalledWith({ message: genericMutationErrorText });
+ expect(createAlert).toHaveBeenCalledWith({ message: genericMutationErrorText });
},
);
});
diff --git a/spec/frontend/ci_variable_list/components/legacy_ci_variable_settings_spec.js b/spec/frontend/ci_variable_list/components/legacy_ci_variable_settings_spec.js
index 9c941f99982..7def4dd4f29 100644
--- a/spec/frontend/ci_variable_list/components/legacy_ci_variable_settings_spec.js
+++ b/spec/frontend/ci_variable_list/components/legacy_ci_variable_settings_spec.js
@@ -9,11 +9,11 @@ Vue.use(Vuex);
describe('Ci variable table', () => {
let wrapper;
let store;
- let isGroup;
+ let isProject;
- const createComponent = (groupState) => {
+ const createComponent = (projectState) => {
store = createStore();
- store.state.isGroup = groupState;
+ store.state.isProject = projectState;
jest.spyOn(store, 'dispatch').mockImplementation();
wrapper = shallowMount(LegacyCiVariableSettings, {
store,
@@ -25,14 +25,14 @@ describe('Ci variable table', () => {
});
it('dispatches fetchEnvironments when mounted', () => {
- isGroup = false;
- createComponent(isGroup);
+ isProject = true;
+ createComponent(isProject);
expect(store.dispatch).toHaveBeenCalledWith('fetchEnvironments');
});
it('does not dispatch fetchenvironments when in group context', () => {
- isGroup = true;
- createComponent(isGroup);
+ isProject = false;
+ createComponent(isProject);
expect(store.dispatch).not.toHaveBeenCalled();
});
});