[Dashboard] Adding timelion panel without asking for the index pattern (#113896)

* [Dashboard] Adding timelion panel without asking for the index pattern

* Adds a functional test
This commit is contained in:
Stratoula Kalafateli 2021-10-05 16:31:39 +03:00 committed by GitHub
parent 433a0e3927
commit 65df961b5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 1 deletions

View file

@ -128,7 +128,10 @@ export const EditorMenu = ({ dashboardContainer, createNewVisType }: Props) => {
name: titleInWizard || title,
icon: icon as string,
onClick:
group === VisGroups.AGGBASED ? createNewAggsBasedVis(visType) : createNewVisType(visType),
// not all the agg-based visualizations need to be created via the wizard
group === VisGroups.AGGBASED && visType.options.showIndexSelection
? createNewAggsBasedVis(visType)
: createNewVisType(visType),
'data-test-subj': `visType-${name}`,
toolTipContent: description,
};

View file

@ -68,6 +68,24 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.dashboard.waitForRenderComplete();
});
it('adds a new timelion visualization', async () => {
// adding this case, as the timelion agg-based viz doesn't need the `clickNewSearch()` step
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
await dashboardAddPanel.clickEditorMenuButton();
await dashboardAddPanel.clickAggBasedVisualizations();
await PageObjects.visualize.clickTimelion();
await PageObjects.visualize.saveVisualizationExpectSuccess(
'timelion visualization from add new link',
{ redirectToOrigin: true }
);
await retry.try(async () => {
const panelCount = await PageObjects.dashboard.getPanelCount();
expect(panelCount).to.eql(originalPanelCount + 1);
});
await PageObjects.dashboard.waitForRenderComplete();
});
it('adds a markdown visualization via the quick button', async () => {
const originalPanelCount = await PageObjects.dashboard.getPanelCount();
await dashboardAddPanel.clickMarkdownQuickButton();