Skip to content

Commit

Permalink
visualize editor should not show if embed is set to true in url (elas…
Browse files Browse the repository at this point in the history
  • Loading branch information
ppisljar committed Jan 29, 2018
1 parent 74f4f45 commit 1e0b259
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
saved-obj="savedVis"
ui-state="uiState"
app-state="state"
editor-mode="true"
editor-mode="chrome.getVisible()"
show-spy-panel="chrome.getVisible()"
>

Expand Down
10 changes: 10 additions & 0 deletions test/functional/apps/visualize/_area_chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import expect from 'expect.js';

export default function ({ getService, getPageObjects }) {
const log = getService('log');
const remote = getService('remote');
const retry = getService('retry');
const PageObjects = getPageObjects(['common', 'visualize', 'header', 'settings']);

Expand Down Expand Up @@ -181,6 +182,15 @@ export default function ({ getService, getPageObjects }) {
expect(data.trim().split('\n')).to.eql(expectedTableData);
});
});

it('should hide side editor if embed is set to true in url', async () => {
const url = await remote.getCurrentUrl();
const embedUrl = url.split('/visualize/').pop().replace('?_g=', '?embed=true&_g=');
await PageObjects.common.navigateToUrl('visualize', embedUrl);
await PageObjects.header.waitUntilLoadingHasFinished();
const sideEditorExists = await PageObjects.visualize.getSideEditorExists();
expect(sideEditorExists).to.be(false);
});
});
});
}
4 changes: 4 additions & 0 deletions test/functional/page_objects/visualize_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
return await testSubjects.exists('spyToggleButton');
}

async getSideEditorExists() {
return await find.existsByCssSelector('.collapsible-sidebar');
}

async openSpyPanel() {
log.debug('openSpyPanel');
const isOpen = await testSubjects.exists('spyContentContainer');
Expand Down

0 comments on commit 1e0b259

Please sign in to comment.