Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nchaulet committed Sep 20, 2021
1 parent 6e9364f commit aef2a44
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/fleet/server/saved_objects/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,14 @@ const getSavedObjectTypes = (
},
mappings: {
properties: {
output_id: { type: 'keyword' },
output_id: { type: 'keyword', index: false },
name: { type: 'keyword' },
type: { type: 'keyword' },
is_default: { type: 'boolean' },
hosts: { type: 'keyword' },
ca_sha256: { type: 'keyword', index: false },
config: { type: 'flattened', index: false },
config_yaml: { type: 'text', index: false },
config: { type: 'flattened' },
config_yaml: { type: 'text' },
is_preconfigured: { type: 'boolean', index: false },
},
},
Expand Down
27 changes: 12 additions & 15 deletions x-pack/plugins/fleet/server/services/preconfiguration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,21 +492,18 @@ describe('output preconfiguration', () => {
mockedOutputService.create.mockReset();
mockedOutputService.update.mockReset();
mockedOutputService.getDefaultESHosts.mockReturnValue(['http://default-es:9200']);
mockedOutputService.get.mockImplementation(async (soClient, id): Promise<Output> => {
switch (id) {
case 'existing-output-1':
return {
id: 'existing-output-1',
is_default: false,
name: 'Output 1',
// @ts-ignore
type: 'elasticsearch',
hosts: ['http://es.co:80'],
is_preconfigured: true,
};
default:
throw soClient.errors.createGenericNotFoundError(id);
}
mockedOutputService.bulkGet.mockImplementation(async (soClient, id): Promise<Output[]> => {
return [
{
id: 'existing-output-1',
is_default: false,
name: 'Output 1',
// @ts-ignore
type: 'elasticsearch',
hosts: ['http://es.co:80'],
is_preconfigured: true,
},
];
});
});

Expand Down

0 comments on commit aef2a44

Please sign in to comment.