2020-08-01 12:20:16 +02:00
|
|
|
const helpers = require("./global-setup");
|
|
|
|
|
|
|
|
describe("Display of modules", function () {
|
|
|
|
helpers.setupTimeout(this);
|
|
|
|
|
2021-04-08 21:12:56 +02:00
|
|
|
let app = null;
|
2020-08-01 12:20:16 +02:00
|
|
|
|
|
|
|
beforeEach(function () {
|
|
|
|
return helpers
|
|
|
|
.startApplication({
|
|
|
|
args: ["js/electron.js"]
|
|
|
|
})
|
|
|
|
.then(function (startedApp) {
|
|
|
|
app = startedApp;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
afterEach(function () {
|
|
|
|
return helpers.stopApplication(app);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("Using helloworld", function () {
|
2021-06-08 00:47:40 +02:00
|
|
|
beforeAll(function () {
|
2020-08-01 12:20:16 +02:00
|
|
|
// Set config sample for use in test
|
|
|
|
process.env.MM_CONFIG_FILE = "tests/configs/modules/display.js";
|
|
|
|
});
|
|
|
|
|
|
|
|
it("should show the test header", async () => {
|
2021-01-30 20:29:59 +01:00
|
|
|
const elem = await app.client.$("#module_0_helloworld .module-header", 10000);
|
2021-06-14 21:07:38 +02:00
|
|
|
return expect(await elem.getText("#module_0_helloworld .module-header")).toBe("TEST_HEADER");
|
2020-08-01 12:20:16 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should show no header if no header text is specified", async () => {
|
2021-01-30 20:29:59 +01:00
|
|
|
const elem = await app.client.$("#module_1_helloworld .module-header", 10000);
|
2021-06-14 21:07:38 +02:00
|
|
|
return expect(await elem.getText("#module_1_helloworld .module-header")).toBe("");
|
2020-08-01 12:20:16 +02:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|