Skip to content

Commit

Permalink
[7.x] Make Index Management functional and API integration tests robu…
Browse files Browse the repository at this point in the history
…st against side effects introduced by Ingest Manager. (#70533) (#70612)

* Make Index Management functional and API integration tests robust against side effects introduced by Ingest Manager. (#70533)

* Update component templates list to render empty prompt inside of content container. Show detail panel when deep-linked, even if there are no component templates. (#70633)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
  • Loading branch information
cjcenizal and elasticmachine authored Jul 3, 2020
1 parent 9a81b04 commit 8d6afa2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ export const ComponentTemplateList: React.FunctionComponent<Props> = ({
trackMetric('loaded', UIM_COMPONENT_TEMPLATE_LIST_LOAD);
}, [trackMetric]);

if (data && data.length === 0) {
return <EmptyPrompt />;
}

let content: React.ReactNode;

if (isLoading) {
Expand All @@ -67,6 +63,8 @@ export const ComponentTemplateList: React.FunctionComponent<Props> = ({
history={history as ScopedHistory}
/>
);
} else if (data && data.length === 0) {
content = <EmptyPrompt />;
} else if (error) {
content = <LoadError onReloadClick={sendRequest} />;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ export default function ({ getService }) {
updateTemplate,
} = registerHelpers({ supertest });

// blocking es snapshot promotion: https://github.com/elastic/kibana/issues/70532
describe.skip('index templates', () => {
describe('index templates', () => {
after(() => Promise.all([cleanUpEsResources()]));

describe('get all', () => {
Expand All @@ -41,8 +40,9 @@ export default function ({ getService }) {
it('should list all the index templates with the expected parameters', async () => {
const { body: allTemplates } = await getAllTemplates().expect(200);

// Composable templates
expect(allTemplates.templates).to.eql([]);
// Composable index templates may have been created by other apps, e.g. Ingest Manager,
// so we don't make any assertion about these contents.
expect(allTemplates.templates).to.be.an('array');

// Legacy templates
const legacyTemplate = allTemplates.legacyTemplates.find(
Expand Down
10 changes: 5 additions & 5 deletions x-pack/test/functional/apps/index_management/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const log = getService('log');
const browser = getService('browser');

// blocking es snapshot promotion: https://github.com/elastic/kibana/issues/70532
describe.skip('Home page', function () {
describe('Home page', function () {
before(async () => {
await pageObjects.common.navigateToApp('indexManagement');
});
Expand Down Expand Up @@ -82,9 +81,10 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const url = await browser.getCurrentUrl();
expect(url).to.contain(`/component_templates`);

// There should be no component templates by default, so we verify the empty prompt displays
const componentTemplateEmptyPrompt = await testSubjects.exists('emptyList');
expect(componentTemplateEmptyPrompt).to.be(true);
// Verify content. Component templates may have been created by other apps, e.g. Ingest Manager,
// so we don't make any assertion about the presence or absence of component templates.
const componentTemplateList = await testSubjects.exists('componentTemplateList');
expect(componentTemplateList).to.be(true);
});
});
});
Expand Down

0 comments on commit 8d6afa2

Please sign in to comment.