2020-04-08 14:13:33 +05:30
|
|
|
import {
|
|
|
|
gapiProjectsResponseMock,
|
|
|
|
gapiZonesResponseMock,
|
|
|
|
gapiMachineTypesResponseMock,
|
|
|
|
} from './mock_data';
|
|
|
|
|
|
|
|
const cloudbilling = {
|
|
|
|
projects: {
|
|
|
|
getBillingInfo: jest.fn(
|
|
|
|
() =>
|
2021-03-08 18:12:59 +05:30
|
|
|
new Promise((resolve) => {
|
2020-04-08 14:13:33 +05:30
|
|
|
resolve({
|
|
|
|
result: { billingEnabled: true },
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const cloudresourcemanager = {
|
|
|
|
projects: {
|
|
|
|
list: jest.fn(
|
|
|
|
() =>
|
2021-03-08 18:12:59 +05:30
|
|
|
new Promise((resolve) => {
|
2020-04-08 14:13:33 +05:30
|
|
|
resolve({
|
|
|
|
result: { ...gapiProjectsResponseMock },
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const compute = {
|
|
|
|
zones: {
|
|
|
|
list: jest.fn(
|
|
|
|
() =>
|
2021-03-08 18:12:59 +05:30
|
|
|
new Promise((resolve) => {
|
2020-04-08 14:13:33 +05:30
|
|
|
resolve({
|
|
|
|
result: { ...gapiZonesResponseMock },
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
machineTypes: {
|
|
|
|
list: jest.fn(
|
|
|
|
() =>
|
2021-03-08 18:12:59 +05:30
|
|
|
new Promise((resolve) => {
|
2020-04-08 14:13:33 +05:30
|
|
|
resolve({
|
|
|
|
result: { ...gapiMachineTypesResponseMock },
|
|
|
|
});
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
const gapi = {
|
|
|
|
client: {
|
|
|
|
cloudbilling,
|
|
|
|
cloudresourcemanager,
|
|
|
|
compute,
|
|
|
|
},
|
|
|
|
};
|
|
|
|
|
|
|
|
export { gapi as default };
|