Skip to content

Commit

Permalink
add more comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Nov 21, 2019
1 parent df61a22 commit dc368e1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions x-pack/test/epm_api_integration/apis/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export default function({ getService }: FtrProviderContext) {

const body = getTemplate(indexPattern);

// This test is not an API integration test with Kibana
// We want to test here if the template is valid and for this we need a running ES instance.
// If the ES instance takes the template, we assume it is a valid template.
const { body: response } = await es.indices.putTemplate({
name: templateName,
body,
Expand All @@ -26,6 +29,8 @@ export default function({ getService }: FtrProviderContext) {

const { body: indexTemplate } = await es.indices.getTemplate({ name: templateName });
// Checks if the content of the template that was loaded is as expected
// We already know based on the above test that the template was valid
// but we check here also if we wrote the index pattern inside the template as expected
expect(indexTemplate[templateName].index_patterns).to.eql([indexPattern]);
});
}

0 comments on commit dc368e1

Please sign in to comment.