Skip to content

Commit

Permalink
adapt usages
Browse files Browse the repository at this point in the history
  • Loading branch information
pgayvallet committed Jul 12, 2023
1 parent 1eace31 commit e03a804
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ const defaultPortCloud = {
cloudHost: 'us-central1.gcp.cloud.es.io',
cloudDefaultPort: '443',
registerCloudService: jest.fn(),
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
};
// 9243
const customPortCloud = {
Expand All @@ -25,17 +29,29 @@ const customPortCloud = {
cloudHost: 'us-central1.gcp.cloud.es.io',
cloudDefaultPort: '9243',
registerCloudService: jest.fn(),
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
};
const missingDeploymentIdCloud = {
cloudId:
'dXMtY2VudHJhbDEuZ2NwLmNsb3VkLmVzLmlvOjkyNDMkYWMzMWViYjkwMjQxNzczMTU3MDQzYzM0ZmQyNmZkNDYkYTRjMDYyMzBlNDhjOGZjZTdiZTg4YTA3NGEzYmIzZTA=',
isCloudEnabled: true,
registerCloudService: jest.fn(),
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
};
const noCloud = {
cloudId: undefined,
isCloudEnabled: false,
registerCloudService: jest.fn(),
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
};

describe('getCloudEnterpriseSearchHost', () => {
Expand Down
4 changes: 4 additions & 0 deletions x-pack/plugins/fleet/.storybook/context/cloud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ export const getCloud = ({ isCloudEnabled }: { isCloudEnabled: boolean }) => {
profileUrl: 'https://profile.url',
snapshotsUrl: 'https://snapshots.url',
registerCloudService: () => {},
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
};

return cloud;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ describe('getCloudFleetServersHosts', () => {
deploymentId: 'deployment-id-1',
cloudHost: 'us-east-1.aws.found.io',
apm: {},
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
});

expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(`
Expand All @@ -138,6 +142,10 @@ describe('getCloudFleetServersHosts', () => {
cloudHost: 'test.fr',
cloudDefaultPort: '9243',
apm: {},
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
});

expect(getCloudFleetServersHosts()).toMatchInlineSnapshot(`
Expand Down Expand Up @@ -171,6 +179,10 @@ describe('createCloudFleetServerHostIfNeeded', () => {
isCloudEnabled: true,
deploymentId: 'deployment-id-1',
apm: {},
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
});
mockedGetDefaultFleetServerHost.mockResolvedValue({
id: 'test',
Expand All @@ -190,6 +202,10 @@ describe('createCloudFleetServerHostIfNeeded', () => {
deploymentId: 'deployment-id-1',
cloudHost: 'us-east-1.aws.found.io',
apm: {},
isServerlessEnabled: false,
serverless: {
projectId: undefined,
},
});
mockedGetDefaultFleetServerHost.mockResolvedValue(null);
soClient.create.mockResolvedValue({
Expand Down

0 comments on commit e03a804

Please sign in to comment.