Merge branch 'develop' into patch-1

This commit is contained in:
Christopher Fenner
2022-01-12 20:39:09 +01:00
committed by GitHub
20 changed files with 1157 additions and 1084 deletions

View File

@@ -1,5 +1,6 @@
const helpers = require("../global-setup");
const serverBasicAuth = require("./basic-auth.js");
const testDelay = 4000;
describe("Calendar module", function () {
/**
@@ -24,7 +25,7 @@ describe("Calendar module", function () {
describe("Default configuration", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/default.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should show the default maximumEntries of 10", () => {
@@ -39,7 +40,7 @@ describe("Calendar module", function () {
describe("Custom configuration", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/custom.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should show the custom maximumEntries of 4", () => {
@@ -62,7 +63,7 @@ describe("Calendar module", function () {
describe("Recurring event", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/recurring.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should show the recurring birthday event 6 times", () => {
@@ -78,7 +79,7 @@ describe("Calendar module", function () {
return i * 60;
};
helpers.startApplication("tests/configs/modules/calendar/recurring.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it('should contain text "Mar 25th" in timezone UTC ' + -i, () => {
@@ -93,7 +94,7 @@ describe("Calendar module", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/changed-port.js");
serverBasicAuth.listen(8010);
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
afterAll(function (done) {
@@ -108,7 +109,7 @@ describe("Calendar module", function () {
describe("Basic auth", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/basic-auth.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should return TestEvents", function () {
@@ -119,7 +120,7 @@ describe("Calendar module", function () {
describe("Basic auth by default", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/auth-default.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should return TestEvents", function () {
@@ -130,7 +131,7 @@ describe("Calendar module", function () {
describe("Basic auth backward compatibility configuration: DEPRECATED", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/old-basic-auth.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should return TestEvents", function () {
@@ -142,7 +143,7 @@ describe("Calendar module", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/calendar/fail-basic-auth.js");
serverBasicAuth.listen(8020);
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
afterAll(function (done) {

View File

@@ -1,4 +1,5 @@
const helpers = require("../global-setup");
const testDelay = 4000;
describe("Newsfeed module", function () {
afterAll(function () {
@@ -8,7 +9,7 @@ describe("Newsfeed module", function () {
describe("Default configuration", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/newsfeed/default.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should show the newsfeed title", function () {
@@ -32,7 +33,7 @@ describe("Newsfeed module", function () {
describe("Custom configuration", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/newsfeed/prohibited_words.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should not show articles with prohibited words", function () {
@@ -51,7 +52,7 @@ describe("Newsfeed module", function () {
describe("Invalid configuration", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/newsfeed/incorrect_url.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should show malformed url warning", function () {
@@ -64,7 +65,7 @@ describe("Newsfeed module", function () {
describe("Ignore items", function () {
beforeAll(function (done) {
helpers.startApplication("tests/configs/modules/newsfeed/ignore_items.js");
helpers.getDocument(done, 3000);
helpers.getDocument(done, testDelay);
});
it("should show empty items info message", function () {

View File

@@ -210,6 +210,20 @@ describe("Weather module", function () {
});
});
describe("Absolute configuration", function () {
beforeAll(function (done) {
startApp("tests/configs/modules/weather/forecastweather_absolute.js", {}, done);
});
it("should render days", function () {
const days = ["Fri", "Sat", "Sun", "Mon", "Tue"];
for (const [index, day] of days.entries()) {
getText(`.weather table.small tr:nth-child(${index + 1}) td:nth-child(1)`, day);
}
});
});
describe("Configuration Options", function () {
beforeAll(function (done) {
startApp("tests/configs/modules/weather/forecastweather_options.js", {}, done);