From 5d8f2f5da14592f6379ac03e9dfb445186d4f5f9 Mon Sep 17 00:00:00 2001 From: Karsten Hassel Date: Sun, 26 Dec 2021 16:10:04 +0100 Subject: [PATCH] iterate over timezones --- tests/e2e/modules/calendar_spec.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/tests/e2e/modules/calendar_spec.js b/tests/e2e/modules/calendar_spec.js index a2b5fdfc..8755eb2c 100644 --- a/tests/e2e/modules/calendar_spec.js +++ b/tests/e2e/modules/calendar_spec.js @@ -68,14 +68,27 @@ describe("Calendar module", function () { it("should show the recurring birthday event 6 times", () => { testElementLength(".calendar .event", 6); }); - - it('should contain text "Mar 25th"', () => { - const elem = document.querySelector(".calendar"); - expect(elem).not.toBe(null); - expect(elem.textContent).toContain("Mar 25th"); - }); }); + process.setMaxListeners(0); + for (let i = -12; i < 12; i++) { + describe("Recurring event per timezone", function () { + beforeAll(function (done) { + Date.prototype.getTimezoneOffset = function () { + return i * 60; + }; + helpers.startApplication("tests/configs/modules/calendar/recurring.js"); + helpers.getDocument(done, 3000); + }); + + it('should contain text "Mar 25th" in timezone UTC ' + -i, () => { + const elem = document.querySelector(".calendar"); + expect(elem).not.toBe(null); + expect(elem.textContent).toContain("Mar 25th"); + }); + }); + } + describe("Changed port", function () { beforeAll(function (done) { helpers.startApplication("tests/configs/modules/calendar/changed-port.js");