4e0e0552c6
each suite needs its own instance of the store, but the state has to be returned via a factory otherwise the suites all share the same reference to one state object
49 lines
1 KiB
JavaScript
49 lines
1 KiB
JavaScript
import {
|
|
gapiProjectsResponseMock,
|
|
gapiZonesResponseMock,
|
|
gapiMachineTypesResponseMock,
|
|
} from './mock_data';
|
|
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
export const gapi = () => ({
|
|
client: {
|
|
cloudbilling: {
|
|
projects: {
|
|
getBillingInfo: () =>
|
|
new Promise(resolve => {
|
|
resolve({
|
|
result: { billingEnabled: true },
|
|
});
|
|
}),
|
|
},
|
|
},
|
|
cloudresourcemanager: {
|
|
projects: {
|
|
list: () =>
|
|
new Promise(resolve => {
|
|
resolve({
|
|
result: { ...gapiProjectsResponseMock },
|
|
});
|
|
}),
|
|
},
|
|
},
|
|
compute: {
|
|
zones: {
|
|
list: () =>
|
|
new Promise(resolve => {
|
|
resolve({
|
|
result: { ...gapiZonesResponseMock },
|
|
});
|
|
}),
|
|
},
|
|
machineTypes: {
|
|
list: () =>
|
|
new Promise(resolve => {
|
|
resolve({
|
|
result: { ...gapiMachineTypesResponseMock },
|
|
});
|
|
}),
|
|
},
|
|
},
|
|
},
|
|
});
|