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/create_cluster/gke_cluster/stores/actions_spec.js')
-rw-r--r--spec/frontend/create_cluster/gke_cluster/stores/actions_spec.js141
1 files changed, 0 insertions, 141 deletions
diff --git a/spec/frontend/create_cluster/gke_cluster/stores/actions_spec.js b/spec/frontend/create_cluster/gke_cluster/stores/actions_spec.js
deleted file mode 100644
index c365cb6a9f4..00000000000
--- a/spec/frontend/create_cluster/gke_cluster/stores/actions_spec.js
+++ /dev/null
@@ -1,141 +0,0 @@
-import testAction from 'helpers/vuex_action_helper';
-import * as actions from '~/create_cluster/gke_cluster/store/actions';
-import * as types from '~/create_cluster/gke_cluster/store/mutation_types';
-import createState from '~/create_cluster/gke_cluster/store/state';
-import gapi from '../helpers';
-import {
- selectedProjectMock,
- selectedZoneMock,
- selectedMachineTypeMock,
- gapiProjectsResponseMock,
- gapiZonesResponseMock,
- gapiMachineTypesResponseMock,
-} from '../mock_data';
-
-describe('GCP Cluster Dropdown Store Actions', () => {
- describe('setProject', () => {
- it('should set project', () => {
- return testAction(
- actions.setProject,
- selectedProjectMock,
- { selectedProject: {} },
- [{ type: 'SET_PROJECT', payload: selectedProjectMock }],
- [],
- );
- });
- });
-
- describe('setZone', () => {
- it('should set zone', () => {
- return testAction(
- actions.setZone,
- selectedZoneMock,
- { selectedZone: '' },
- [{ type: 'SET_ZONE', payload: selectedZoneMock }],
- [],
- );
- });
- });
-
- describe('setMachineType', () => {
- it('should set machine type', () => {
- return testAction(
- actions.setMachineType,
- selectedMachineTypeMock,
- { selectedMachineType: '' },
- [{ type: 'SET_MACHINE_TYPE', payload: selectedMachineTypeMock }],
- [],
- );
- });
- });
-
- describe('setIsValidatingProjectBilling', () => {
- it('should set machine type', () => {
- return testAction(
- actions.setIsValidatingProjectBilling,
- true,
- { isValidatingProjectBilling: null },
- [{ type: 'SET_IS_VALIDATING_PROJECT_BILLING', payload: true }],
- [],
- );
- });
- });
-
- describe('async fetch methods', () => {
- let originalGapi;
-
- beforeAll(() => {
- originalGapi = window.gapi;
- window.gapi = gapi;
- window.gapiPromise = Promise.resolve(gapi);
- });
-
- afterAll(() => {
- window.gapi = originalGapi;
- delete window.gapiPromise;
- });
-
- describe('fetchProjects', () => {
- it('fetches projects from Google API', () => {
- const state = createState();
-
- return testAction(
- actions.fetchProjects,
- null,
- state,
- [{ type: types.SET_PROJECTS, payload: gapiProjectsResponseMock.projects }],
- [],
- );
- });
- });
-
- describe('validateProjectBilling', () => {
- it('checks project billing status from Google API', () => {
- return testAction(
- actions.validateProjectBilling,
- true,
- {
- selectedProject: selectedProjectMock,
- selectedZone: '',
- selectedMachineType: '',
- projectHasBillingEnabled: null,
- },
- [
- { type: 'SET_ZONE', payload: '' },
- { type: 'SET_MACHINE_TYPE', payload: '' },
- { type: 'SET_PROJECT_BILLING_STATUS', payload: true },
- ],
- [{ type: 'setIsValidatingProjectBilling', payload: false }],
- );
- });
- });
-
- describe('fetchZones', () => {
- it('fetches zones from Google API', () => {
- const state = createState();
-
- return testAction(
- actions.fetchZones,
- null,
- state,
- [{ type: types.SET_ZONES, payload: gapiZonesResponseMock.items }],
- [],
- );
- });
- });
-
- describe('fetchMachineTypes', () => {
- it('fetches machine types from Google API', () => {
- const state = createState();
-
- return testAction(
- actions.fetchMachineTypes,
- null,
- state,
- [{ type: types.SET_MACHINE_TYPES, payload: gapiMachineTypesResponseMock.items }],
- [],
- );
- });
- });
- });
-});