Skip to content

Commit 7768759

Browse files
author
Stacey Gammon
committed
Fix full screen toggle button when panel is expanded (elastic#13320)
* Add failing tests * Fix style issues with full screen toggle
1 parent 679d8ad commit 7768759

File tree

5 files changed

+85
-3
lines changed

5 files changed

+85
-3
lines changed

src/core_plugins/kibana/public/dashboard/dashboard.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
class="exitFullScreenMode"
88
ng-click="exitFullScreenMode()"
99
>
10-
<span class="exitFullScreenModeLogo"></span>
11-
<span class="exitFullScreenModeText">
10+
<span class="exitFullScreenModeLogo" data-test-subj="exitFullScreenModeLogo"></span>
11+
<span class="exitFullScreenModeText" data-test-subj="exitFullScreenModeText">
1212
Exit full screen
1313
<span class="kuiIcon fa fa-angle-left"></span>
1414
</span>

src/core_plugins/kibana/public/dashboard/styles/index.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
padding: 0;
2020
border: none;
2121
background: none;
22+
z-index: 5;
2223
}
2324

2425

src/ui/public/styles/base.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ a {
133133
.app-container {
134134
> * {
135135
position: relative;
136-
z-index: 0;
137136
}
138137

139138
.kibana-nav-options {

test/functional/apps/dashboard/_dashboard.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,57 @@ export default function ({ getService, getPageObjects }) {
220220
});
221221
});
222222

223+
describe('full screen mode', () => {
224+
it('option not available in edit mode', async () => {
225+
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();
226+
expect(exists).to.be(false);
227+
});
228+
229+
it('available in view mode', async () => {
230+
await PageObjects.dashboard.saveDashboard('full screen test');
231+
const exists = await PageObjects.dashboard.fullScreenModeMenuItemExists();
232+
expect(exists).to.be(true);
233+
});
234+
235+
it('hides the chrome', async () => {
236+
let isChromeVisible = await PageObjects.common.isChromeVisible();
237+
expect(isChromeVisible).to.be(true);
238+
239+
await PageObjects.dashboard.clickFullScreenMode();
240+
241+
await retry.try(async () => {
242+
isChromeVisible = await PageObjects.common.isChromeVisible();
243+
expect(isChromeVisible).to.be(false);
244+
});
245+
});
246+
247+
it('displays exit full screen logo button', async () => {
248+
const exists = await PageObjects.dashboard.exitFullScreenLogoButtonExists();
249+
expect(exists).to.be(true);
250+
});
251+
252+
it('displays exit full screen logo button when panel is expanded', async () => {
253+
await PageObjects.dashboard.toggleExpandPanel();
254+
255+
const exists = await PageObjects.dashboard.exitFullScreenTextButtonExists();
256+
expect(exists).to.be(true);
257+
});
258+
259+
it('exits when the text button is clicked on', async () => {
260+
const logoButton = await PageObjects.dashboard.getExitFullScreenLogoButton();
261+
await remote.moveMouseTo(logoButton);
262+
await PageObjects.dashboard.clickExitFullScreenTextButton();
263+
264+
await retry.try(async () => {
265+
const isChromeVisible = await PageObjects.common.isChromeVisible();
266+
expect(isChromeVisible).to.be(true);
267+
});
268+
});
269+
});
270+
223271
describe('add new visualization link', () => {
224272
it('adds a new visualization', async () => {
273+
await PageObjects.dashboard.clickEdit();
225274
await PageObjects.dashboard.clickAddVisualization();
226275
await PageObjects.dashboard.clickAddNewVisualizationLink();
227276
await PageObjects.visualize.clickAreaChart();

test/functional/page_objects/dashboard_page.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,39 @@ export function DashboardPageProvider({ getService, getPageObjects }) {
3333
return logstash;
3434
}
3535

36+
async clickFullScreenMode() {
37+
log.debug(`clickFullScreenMode`);
38+
await testSubjects.click('dashboardFullScreenMode');
39+
}
40+
41+
async fullScreenModeMenuItemExists() {
42+
return await testSubjects.exists('dashboardFullScreenMode');
43+
}
44+
45+
async exitFullScreenTextButtonExists() {
46+
return await testSubjects.exists('exitFullScreenModeText');
47+
}
48+
49+
async getExitFullScreenTextButton() {
50+
return await testSubjects.find('exitFullScreenModeText');
51+
}
52+
53+
async exitFullScreenLogoButtonExists() {
54+
return await testSubjects.exists('exitFullScreenModeLogo');
55+
}
56+
57+
async getExitFullScreenLogoButton() {
58+
return await testSubjects.find('exitFullScreenModeLogo');
59+
}
60+
61+
async clickExitFullScreenLogoButton() {
62+
await testSubjects.click('exitFullScreenModeLogo');
63+
}
64+
65+
async clickExitFullScreenTextButton() {
66+
await testSubjects.click('exitFullScreenModeText');
67+
}
68+
3669
/**
3770
* Returns true if already on the dashboard landing page (that page doesn't have a link to itself).
3871
* @returns {Promise<boolean>}

0 commit comments

Comments
 (0)