Skip to content

Commit

Permalink
remove duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
ruflin committed Nov 26, 2019
1 parent 2312dd2 commit 07ce221
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions x-pack/test/epm_api_integration/apis/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,11 @@ export default function({ getService }: FtrProviderContext) {
});
// Checks if template loading worked as expected
expect(response).to.eql({ acknowledged: true });
const { body: indexTemplate } = await es.indices.getTemplate({ name: templateName });
expect(indexTemplate[templateName].index_patterns).to.eql([indexPattern]);

expect(response).to.eql({ acknowledged: true });

const { body: indexTemplate } = await es.indices.getTemplate({ name: templateName });
const { body } = 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]);
expect(body[templateName].index_patterns).to.eql([indexPattern]);
});
});
}

0 comments on commit 07ce221

Please sign in to comment.