Commit 44bb7aef authored by Illya Klymov's avatar Illya Klymov Committed by Clement Ho

Add missing window.gapi mock

parent 9b93822f
......@@ -4,6 +4,7 @@ import { createStore } from '~/create_cluster/gke_cluster/store';
import { SET_PROJECTS } from '~/create_cluster/gke_cluster/store/mutation_types';
import { mountComponentWithStore } from 'spec/helpers/vue_mount_component_helper';
import { emptyProjectMock, selectedProjectMock } from '../mock_data';
import { gapi } from '../helpers';
const componentConfig = {
docsUrl: 'https://console.cloud.google.com/home/dashboard',
......@@ -32,6 +33,16 @@ describe('GkeProjectIdDropdown', () => {
let vm;
let store;
let originalGapi;
beforeAll(() => {
originalGapi = window.gapi;
window.gapi = gapi();
});
afterAll(() => {
window.gapi = originalGapi;
});
beforeEach(() => {
store = createStore();
vm = createComponent(store);
......
......@@ -64,7 +64,15 @@ describe('GCP Cluster Dropdown Store Actions', () => {
});
describe('async fetch methods', () => {
let originalGapi;
beforeAll(() => {
originalGapi = window.gapi;
window.gapi = gapi();
});
afterAll(() => {
window.gapi = originalGapi;
});
describe('fetchProjects', () => {
it('fetches projects from Google API', done => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment