Skip to content

Commit

Permalink
[Reporting/Visualisation] DOM attributes for reporting integration ar…
Browse files Browse the repository at this point in the history
…e missing (elastic#52109)
  • Loading branch information
Dosant authored and timductive committed Dec 16, 2019
1 parent 99aeada commit 56cb42c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ export class VisualizeEmbeddable extends Embeddable<VisualizeInput, VisualizeOut

div.setAttribute('data-test-subj', 'visualizationLoader');
div.setAttribute('data-shared-item', '');
div.setAttribute('data-shared-item-container', '');
div.setAttribute('data-rendering-count', '0');
div.setAttribute('data-render-complete', 'false');

Expand Down
4 changes: 3 additions & 1 deletion test/functional/apps/visualize/_shared_item.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function ({ getService, getPageObjects }) {
await PageObjects.common.navigateToApp('visualize');
});

it('should have the correct data-shared-item title and description', async function () {
it('should have the correct data-shared-item title and description, and sharedItemContainer should exist', async function () {
const expected = {
title: 'Shared-Item Visualization AreaChart',
description: 'AreaChart'
Expand All @@ -41,6 +41,8 @@ export default function ({ getService, getPageObjects }) {
const { title, description } = await PageObjects.common.getSharedItemTitleAndDescription();
expect(title).to.eql(expected.title);
expect(description).to.eql(expected.description);
const sharedItemContainers = await PageObjects.common.getSharedItemContainers();
expect(sharedItemContainers.length).to.be(1);
});
});
});
Expand Down
5 changes: 5 additions & 0 deletions test/functional/page_objects/common_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,11 @@ export function CommonPageProvider({ getService, getPageObjects }: FtrProviderCo
};
}

async getSharedItemContainers() {
const cssSelector = '[data-shared-item-container]';
return find.allByCssSelector(cssSelector);
}

async ensureModalOverlayHidden() {
return retry.try(async () => {
const shown = await testSubjects.exists('confirmModalTitleText');
Expand Down

0 comments on commit 56cb42c

Please sign in to comment.