Skip to content

Commit

Permalink
[Reporting/Screenshots] add error for no shared items container found…
Browse files Browse the repository at this point in the history
… on the page
  • Loading branch information
tsullivan committed Dec 5, 2019
1 parent 66c7ae6 commit 0951fde
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +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-shared-items-container', '');
div.setAttribute('data-rendering-count', '0');
div.setAttribute('data-render-complete', 'false');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,11 @@ export const getElementPositionAndAttributes = async (
args: [layout.selectors.screenshot, { title: 'data-title', description: 'data-description' }],
});

if (elementsPositionAndAttributes.length === 0) {
throw new Error(
`No shared items containers were found on the page! Reporting requires an element with the '${layout.selectors.screenshot}' attributes on the page.`
);
}

return elementsPositionAndAttributes;
};

0 comments on commit 0951fde

Please sign in to comment.