-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
54 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { assert } from "chai"; | ||
|
||
describe("Page content with 100% height", () => { | ||
before(async () => { | ||
await browser.url(`test/pages/DynamicPageWithFullscreenContent.html`); | ||
}); | ||
|
||
it("footer does not hide the content", async () => { | ||
const page = await browser.$("#page"); | ||
const content = await browser.$("#content"); | ||
const footer = await browser.$("#footer"); | ||
|
||
assert.ok(await page.getProperty("showFooter"), "Footer is shown"); | ||
|
||
const contentBottom = await browser.execute((el) => { | ||
return el.getBoundingClientRect().bottom; | ||
}, content); | ||
const footerTop = await browser.execute((el) => { | ||
return el.getBoundingClientRect().top; | ||
}, footer); | ||
|
||
assert.ok(contentBottom <= footerTop, "No overlap"); | ||
}); | ||
|
||
it("content expands to fill the space between header and footer", async () => { | ||
const page = await browser.$("#page"); | ||
const content = await browser.$("#content"); | ||
const header = await browser.$("#page ui5-dynamic-page-header"); | ||
const footerSpacer = await page.shadow$(".ui5-dynamic-page-spacer"); | ||
|
||
assert.ok(await page.getProperty("showFooter"), "Footer is shown"); | ||
|
||
const headerBottom = await browser.execute((el) => { | ||
return el.getBoundingClientRect().bottom; | ||
}, header); | ||
|
||
const footerTop = await browser.execute((el) => { | ||
return el.getBoundingClientRect().top; | ||
}, footerSpacer); | ||
|
||
const contentTop = await browser.execute((el) => { | ||
return el.getBoundingClientRect().top; | ||
}, content); | ||
|
||
const contentBottom = await browser.execute((el) => { | ||
return el.getBoundingClientRect().bottom; | ||
}, content); | ||
|
||
assert.strictEqual(contentTop, headerBottom, "Content is rendered right below header"); | ||
assert.strictEqual(contentBottom, footerTop, "Content is rendered right above footer"); | ||
}); | ||
|
||
}); |