Skip to content

Commit

Permalink
Added map functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cqliu1 committed Feb 2, 2021
1 parent 9c9f250 commit 85f5bdd
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions x-pack/test/functional/apps/maps/embeddable/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export default function ({ getPageObjects, getService }) {
const PageObjects = getPageObjects(['common', 'dashboard', 'maps']);
const kibanaServer = getService('kibanaServer');
const filterBar = getService('filterBar');
const find = getService('find');
const dashboardAddPanel = getService('dashboardAddPanel');
const dashboardPanelActions = getService('dashboardPanelActions');
const inspector = getService('inspector');
const testSubjects = getService('testSubjects');
Expand Down Expand Up @@ -142,5 +144,39 @@ export default function ({ getPageObjects, getService }) {
await browser.goBack();
expect(await PageObjects.dashboard.onDashboardLandingPage()).to.be(true);
});

it('unlink lens panel from embeddable library', async () => {
await PageObjects.common.navigateToApp('dashboard');
await PageObjects.dashboard.clickNewDashboard();
await dashboardAddPanel.clickOpenAddPanel();
await dashboardAddPanel.filterEmbeddableNames('lnsPieVis');
await find.clickByButtonText('lnsPieVis');
await dashboardAddPanel.closeAddPanel();

const originalPanel = await testSubjects.find('embeddablePanelHeading-lnsPieVis');
await dashboardPanelActions.unlinkFromLibary(originalPanel);
await testSubjects.existOrFail('unlinkPanelSuccess');

const updatedPanel = await testSubjects.find('embeddablePanelHeading-lnsPieVis');
const libraryActionExists = await testSubjects.descendantExists(
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION',
updatedPanel
);
expect(libraryActionExists).to.be(false);
});

it('save lens panel to embeddable library', async () => {
const originalPanel = await testSubjects.find('embeddablePanelHeading-lnsPieVis');
await dashboardPanelActions.saveToLibrary('lnsPieVis - copy', originalPanel);
await testSubjects.click('confirmSaveSavedObjectButton');
await testSubjects.existOrFail('addPanelToLibrarySuccess');

const updatedPanel = await testSubjects.find('embeddablePanelHeading-lnsPieVis-copy');
const libraryActionExists = await testSubjects.descendantExists(
'embeddablePanelNotification-ACTION_LIBRARY_NOTIFICATION',
updatedPanel
);
expect(libraryActionExists).to.be(true);
});
});
}

0 comments on commit 85f5bdd

Please sign in to comment.