2023-01-01 18:09:08 +01:00
|
|
|
const helpers = require("./helpers/global-setup");
|
2021-09-23 22:52:32 +02:00
|
|
|
|
2022-09-20 23:43:06 +02:00
|
|
|
describe("Display of modules", () => {
|
2023-01-01 18:09:08 +01:00
|
|
|
beforeAll(async () => {
|
|
|
|
|
await helpers.startApplication("tests/configs/modules/display.js");
|
|
|
|
|
await helpers.getDocument();
|
2021-09-23 22:52:32 +02:00
|
|
|
});
|
2022-09-20 23:43:06 +02:00
|
|
|
afterAll(async () => {
|
2022-05-27 19:46:28 +02:00
|
|
|
await helpers.stopApplication();
|
2021-09-23 22:52:32 +02:00
|
|
|
});
|
|
|
|
|
|
2023-01-01 18:09:08 +01:00
|
|
|
it("should show the test header", async () => {
|
|
|
|
|
const elem = await helpers.waitForElement("#module_0_helloworld .module-header");
|
2024-01-01 15:38:08 +01:00
|
|
|
expect(elem).not.toBeNull();
|
2024-09-18 07:37:09 +02:00
|
|
|
// textContent returns lowercase here, the uppercase is realized by CSS, which therefore does not end up in textContent
|
2023-01-01 18:09:08 +01:00
|
|
|
expect(elem.textContent).toBe("test_header");
|
2021-09-23 22:52:32 +02:00
|
|
|
});
|
|
|
|
|
|
2023-01-01 18:09:08 +01:00
|
|
|
it("should show no header if no header text is specified", async () => {
|
|
|
|
|
const elem = await helpers.waitForElement("#module_1_helloworld .module-header");
|
2024-01-01 15:38:08 +01:00
|
|
|
expect(elem).not.toBeNull();
|
2023-01-01 18:09:08 +01:00
|
|
|
expect(elem.textContent).toBe("undefined");
|
2021-09-23 22:52:32 +02:00
|
|
|
});
|
|
|
|
|
});
|