Skip to content

Commit

Permalink
Update more tests to be aware of component templates
Browse files Browse the repository at this point in the history
  • Loading branch information
John Schulz committed Jun 16, 2021
1 parent 3c4fcee commit 4cd08b9
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions x-pack/test/fleet_api_integration/apis/epm/update_assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,40 @@ export default function (providerContext: FtrProviderContext) {
);
expect(resPipeline2.statusCode).equal(404);
});
it('should have updated the template components', async function () {
const res = await es.transport.request({
it('should have updated the component templates', async function () {
const resMappings = await es.transport.request({
method: 'GET',
path: `/_component_template/${logsTemplateName}-mappings`,
});
expect(res.statusCode).equal(200);
expect(res.body.component_templates[0].component_template.template.mappings).eql({
expect(resMappings.statusCode).equal(200);
expect(resMappings.body.component_templates[0].component_template.template.mappings).eql({
dynamic: true,
});
const resSettings = await es.transport.request({
method: 'GET',
path: `/_component_template/${logsTemplateName}-settings`,
});
expect(res.statusCode).equal(200);
expect(resSettings.statusCode).equal(200);
expect(resSettings.body.component_templates[0].component_template.template.settings).eql({
index: { lifecycle: { name: 'reference2' } },
});
const resUserSettings = await es.transport.request({
method: 'GET',
path: `/_component_template/${logsTemplateName}-user_settings`,
});
expect(resUserSettings.statusCode).equal(200);
expect(resUserSettings.body).eql({
component_templates: [
{
name: 'logs-all_assets.test_logs-user_settings',
component_template: {
template: {
settings: {},
},
},
},
],
});
});
it('should have updated the index patterns', async function () {
const resIndexPatternLogs = await kibanaServer.savedObjects.get({
Expand Down Expand Up @@ -321,6 +338,18 @@ export default function (providerContext: FtrProviderContext) {
id: 'logs-all_assets.test_logs',
type: 'index_template',
},
{
id: 'logs-all_assets.test_logs-mappings',
type: 'component_template',
},
{
id: 'logs-all_assets.test_logs-settings',
type: 'component_template',
},
{
id: 'logs-all_assets.test_logs-user_settings',
type: 'component_template',
},
{
id: 'logs-all_assets.test_logs2',
type: 'index_template',
Expand Down

0 comments on commit 4cd08b9

Please sign in to comment.