From d41e2b134dc3c2524afd50fe76bc727cff96a2d6 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sat, 4 Jan 2025 16:40:59 -0600 Subject: [PATCH 01/11] fix #3267, CORRECTLY, add testcase, add testcase for #3279 --- js/server.js | 2 +- modules/default/calendar/calendar.js | 15 +- .../modules/calendar/countCalendarEvents.js | 39 +++++ tests/configs/modules/calendar/symboltest.js | 28 +++ tests/electron/modules/calendar_spec.js | 27 ++- tests/mocks/12_events.ics | 164 ++++++++++++++++++ tests/testNotification/testNotification.js | 59 +++++++ 7 files changed, 324 insertions(+), 10 deletions(-) create mode 100644 tests/configs/modules/calendar/countCalendarEvents.js create mode 100644 tests/configs/modules/calendar/symboltest.js create mode 100644 tests/mocks/12_events.ics create mode 100644 tests/testNotification/testNotification.js diff --git a/js/server.js b/js/server.js index dd8b7b2e98..77fe5f2190 100644 --- a/js/server.js +++ b/js/server.js @@ -72,7 +72,7 @@ function Server (config) { app.use(helmet(config.httpHeaders)); app.use("/js", express.static(__dirname)); - let directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs", "/tests/mocks"]; + let directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs", "/tests/mocks", "/tests"]; for (const directory of directories) { app.use(directory, express.static(path.resolve(global.root_path + directory))); } diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 2610b23939..51d8df58f2 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -689,10 +689,11 @@ Module.register("calendar", { by_url_calevents.push(event); } } - by_url_calevents.sort(function (a, b) { - return a.startDate - b.startDate; - }); - if (limitNumberOfEntries) { + if (true, limitNumberOfEntries) { + // sort entries before clipping + by_url_calevents.sort(function (a, b) { + return a.startDate - b.startDate; + }); Log.debug(`pushing ${by_url_calevents.length} events to total with room for ${remainingEntries}`); events = events.concat(by_url_calevents.slice(0, remainingEntries)); Log.debug(`events for calendar=${events.length}`); @@ -911,7 +912,11 @@ Module.register("calendar", { let p = this.getCalendarProperty(url, property, defaultValue); if (property === "symbol" || property === "recurringSymbol" || property === "fullDaySymbol") { const className = this.getCalendarProperty(url, "symbolClassName", this.config.defaultSymbolClassName); - if (p instanceof Array) p.push(className); + if (p instanceof Array) { + let t = []; + p.forEach((n) => { t.push(className + n); }); + p = t; + } else p = className + p; } if (!(p instanceof Array)) p = [p]; diff --git a/tests/configs/modules/calendar/countCalendarEvents.js b/tests/configs/modules/calendar/countCalendarEvents.js new file mode 100644 index 0000000000..d9d370b0e3 --- /dev/null +++ b/tests/configs/modules/calendar/countCalendarEvents.js @@ -0,0 +1,39 @@ +let config = { + address: "0.0.0.0", + ipWhitelist: [], + timeFormat: 12, + foreignModulesDir: "tests", + modules: [ + { + module: "calendar", + position: "bottom_bar", + + config: { + maximumEntries: 1, + calendars: [ + { + fetchInterval: 10000, //7 * 24 * 60 * 60 * 1000, + symbol: ["calendar-check", "google"], + url: "http://localhost:8080/tests/mocks/12_events.ics" + } + ] + } + }, + { + module: "testNotification", + position: "bottom_bar", + config: { + debug: true, + match: { + matchtype: "count", + notificationID: "CALENDAR_EVENTS" + } + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/configs/modules/calendar/symboltest.js b/tests/configs/modules/calendar/symboltest.js new file mode 100644 index 0000000000..f31c54d84b --- /dev/null +++ b/tests/configs/modules/calendar/symboltest.js @@ -0,0 +1,28 @@ + +let config = { + address: "0.0.0.0", + ipWhitelist: [], + timeFormat: 12, + + modules: [ + { + module: "calendar", + position: "bottom_bar", + config: { + maximumEntries: 1, + calendars: [ + { + fetchInterval: 7 * 24 * 60 * 60 * 1000, + symbol: ["calendar-check", "google"], + url: "https://ics.calendarlabs.com/76/mm3137/US_Holidays.ics" + } + ] + } + } + ] +}; + +/*************** DO NOT EDIT THE LINE BELOW ***************/ +if (typeof module !== "undefined") { + module.exports = config; +} diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index f73d673489..debb6f623d 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -12,10 +12,11 @@ describe("Calendar module", () => { await expect(elem.isVisible()).resolves.toBe(true); return true; }; + //doTestTableContent(".testNotification tr", "td.elementCount", "12", first)).resolves.toBe(true); - const doTestCount = async () => { + const doTestCount = async (locator = ".calendar .event") => { expect(global.page).not.toBeNull(); - const loc = await global.page.locator(".calendar .event"); + const loc = await global.page.locator(locator); const elem = loc.first(); await elem.waitFor(); expect(elem).not.toBeNull(); @@ -32,8 +33,8 @@ describe("Calendar module", () => { // uses playwright nth locator syntax const doTestTableContent = async (table_row, table_column, content, row = first) => { const elem = await global.page.locator(table_row); - const date = await global.page.locator(table_column).locator(`nth=${row}`); - await expect(date.textContent()).resolves.toContain(content); + const column = await elem.locator(table_column).locator(`nth=${row}`); + await expect(column.textContent()).resolves.toContain(content); return true; }; @@ -279,4 +280,22 @@ describe("Calendar module", () => { }); }); + describe("count and check symbols", () => { + it("in array", async () => { + await helpers.startApplication("tests/configs/modules/calendar/symboltest.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Chicago"); + // just + await expect(doTestCount(".calendar .event .symbol .fa-fw")).resolves.toBe(2); + await expect(doTestCount(".calendar .event .symbol .fa-calendar-check")).resolves.toBe(1); + await expect(doTestCount(".calendar .event .symbol .fa-google")).resolves.toBe(1); + + }); + }); + + describe("count events broadcast", () => { + it("with maxentries set to 12", async () => { + await helpers.startApplication("tests/configs/modules/calendar/countCalendarEvents.js", "01 Jan 2024 12:30:00 GMT-076:00", ["js/electron.js"], "America/Chicago"); + await new Promise((r) => setTimeout(r, 60000)); + await expect(doTestTableContent(".testNotification", ".elementCount", "12", first)).resolves.toBe(true); + }); + }); }); diff --git a/tests/mocks/12_events.ics b/tests/mocks/12_events.ics new file mode 100644 index 0000000000..f89c938129 --- /dev/null +++ b/tests/mocks/12_events.ics @@ -0,0 +1,164 @@ +BEGIN:VCALENDAR +VERSION:2.0 +PRODID:-//Calendar Labs//Calendar 1.0//EN +CALSCALE:GREGORIAN +METHOD:PUBLISH +X-WR-CALNAME:US Holidays +X-WR-TIMEZONE:Etc/GMT +BEGIN:VEVENT +SUMMARY:Start of Month 1 +DTSTART:20190101 +DTEND:20190101 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949sada28d231582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 2 +DTSTART:20190201 +DTEND:20190201 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949a2wds8d231582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 3 +DTSTART:20190301 +DTEND:20190301 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949a2SDD8d231582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 4 +DTSTART:20190401 +DTEND:20190401 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949a2SDD8d231582FDSFD470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 5 +DTSTART:20190501 +DTEND:20190501 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949a2SDD8d2DD315824702598@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 6 +DTSTART:20190601 +DTEND:20190601 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949a2SDD8d2DD31582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 7 +DTSTART:20190701 +DTEND:20190701 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52942SDD8d2DD31582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 8 +DTSTART:20190801 +DTEND:20190801 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e52949a2SDD8d2DDt31582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 9 +DTSTART:20190901 +DTEND:20190901 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e529449a2SDD8d2DDt315824702798@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 10 +DTSTART:20191001 +DTEND:20191001 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e529449a2SDD8d2DDt31582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 11 +DTSTART:20191101 +DTEND:20191101 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e5294449a2SDD8d2DDt31582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +BEGIN:VEVENT +SUMMARY:Start of Month 12 +DTSTART:20191201 +DTEND:20191201 +RRULE:FREQ=YEARLY;WKST=SU;INTERVAL=1 +LOCATION:United States +DESCRIPTION:Visit https://calendarlabs.com/holidays/us/new-years-day.php to know more about New Year's Day. \n\n Like us on Facebook: http://fb.com/calendarlabs to get updates +UID:5e5294a2SDD8d2DDt31582470298@calendarlabs.com +DTSTAMP:20200223T150458Z +STATUS:CONFIRMED +TRANSP:TRANSPARENT +SEQUENCE:0 +END:VEVENT +END:VCALENDAR diff --git a/tests/testNotification/testNotification.js b/tests/testNotification/testNotification.js new file mode 100644 index 0000000000..735af025a3 --- /dev/null +++ b/tests/testNotification/testNotification.js @@ -0,0 +1,59 @@ +Module.register("testNotification", { + defaults: { + debug: false, + match: { + notificationID: "", + matchtype: "count" + //or + // type: 'contents' // look for item in field of content + } + }, + count: 0, + table: null, + notificationReceived (notification, payload) { + if (notification === this.config.match.notificationID) { + if (this.config.match.matchtype === "count") { + this.count = payload.length; + if (this.count) { + this.table = document.createElement("table"); + this.addTableRow(this.table, null, `${this.count}:elementCount`); + if (this.config.debug) { + payload.forEach((e, i) => { + this.addTableRow(this.table, i, e.title); + }); + } + } + + this.updateDom(); + } + } + }, + maketd (row, info) { + let td = document.createElement("td"); + row.appendChild(td); + if (info !== null) { + let colinfo = info.toString().split(":"); + if (colinfo.length === 2) td.className = colinfo[1]; + td.innerText = colinfo[0]; + } + return td; + }, + addTableRow (table, col1 = null, col2 = null, col3 = null) { + let tableRow = document.createElement("tr"); + table.appendChild(tableRow); + + let tablecol1 = this.maketd(tableRow, col1); + let tablecol2 = this.maketd(tableRow, col2); + let tablecol3 = this.maketd(tableRow, col3); + + return tableRow; + }, + getDom () { + let wrapper = document.createElement("div"); + if (this.table) { + wrapper.appendChild(this.table); + } + return wrapper; + } + +}); From 46fbc158e1cc8d188044fccab896c8d74e1d2113 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sat, 4 Jan 2025 16:59:01 -0600 Subject: [PATCH 02/11] add changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddba26071d..3207b781df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ planned for 2025-04-01 ### Fixed - [calendar] fix clipping events being broadcast (#3678) +- [calendar] fix arrayed symbols, #3267, again, add testcase ## [2.30.0] - 2025-01-01 From 38339426a83c05c312747f4159f7bec12991f885 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sat, 4 Jan 2025 17:05:37 -0600 Subject: [PATCH 03/11] remove test indicator --- modules/default/calendar/calendar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/default/calendar/calendar.js b/modules/default/calendar/calendar.js index 51d8df58f2..e2f921db28 100644 --- a/modules/default/calendar/calendar.js +++ b/modules/default/calendar/calendar.js @@ -689,7 +689,7 @@ Module.register("calendar", { by_url_calevents.push(event); } } - if (true, limitNumberOfEntries) { + if (limitNumberOfEntries) { // sort entries before clipping by_url_calevents.sort(function (a, b) { return a.startDate - b.startDate; From efc0fd44a651f9d682243d16f83c722e2fca09c7 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sat, 4 Jan 2025 17:11:38 -0600 Subject: [PATCH 04/11] update changelog with second issue number for testcase --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3207b781df..2b31f2dad0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ planned for 2025-04-01 ### Fixed - [calendar] fix clipping events being broadcast (#3678) -- [calendar] fix arrayed symbols, #3267, again, add testcase +- [calendar] fix arrayed symbols, #3267, again, add testcase, add testcase for #3678 ## [2.30.0] - 2025-01-01 From 577d79781154a342d6cc39d09624d7f60d6c76a1 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sat, 4 Jan 2025 21:16:56 -0600 Subject: [PATCH 05/11] fix app.js to map default modules in during test with foreignDir set to tests --- js/app.js | 2 +- tests/electron/modules/calendar_spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/js/app.js b/js/app.js index 020139439a..ef84f44582 100644 --- a/js/app.js +++ b/js/app.js @@ -177,7 +177,7 @@ function App () { moduleFolder = defaultModuleFolder; } else { // running in Jest, allow defaultModules placed under moduleDir for testing - if (env.modulesDir === "modules") { + if (env.modulesDir === "modules" || env.modulesDir === "tests") { moduleFolder = defaultModuleFolder; } } diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index debb6f623d..93bd137bd9 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -292,9 +292,9 @@ describe("Calendar module", () => { }); describe("count events broadcast", () => { - it("with maxentries set to 12", async () => { + it("get 12 with maxentries set to 1", async () => { await helpers.startApplication("tests/configs/modules/calendar/countCalendarEvents.js", "01 Jan 2024 12:30:00 GMT-076:00", ["js/electron.js"], "America/Chicago"); - await new Promise((r) => setTimeout(r, 60000)); + //await new Promise((r) => setTimeout(r, 60000)); await expect(doTestTableContent(".testNotification", ".elementCount", "12", first)).resolves.toBe(true); }); }); From d71f49602104ca30c770c7382646c171b9a93b12 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sat, 4 Jan 2025 21:35:14 -0600 Subject: [PATCH 06/11] remove dead test line fro test runner --- tests/electron/modules/calendar_spec.js | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index 93bd137bd9..5a9d483006 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -294,7 +294,6 @@ describe("Calendar module", () => { describe("count events broadcast", () => { it("get 12 with maxentries set to 1", async () => { await helpers.startApplication("tests/configs/modules/calendar/countCalendarEvents.js", "01 Jan 2024 12:30:00 GMT-076:00", ["js/electron.js"], "America/Chicago"); - //await new Promise((r) => setTimeout(r, 60000)); await expect(doTestTableContent(".testNotification", ".elementCount", "12", first)).resolves.toBe(true); }); }); From d913d842672c77e53aeb6b668fcc2cedadcc79b0 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 5 Jan 2025 10:03:27 -0600 Subject: [PATCH 07/11] move test module to mock, fix server paths amd testcase config --- js/app.js | 2 +- js/server.js | 2 +- tests/configs/modules/calendar/countCalendarEvents.js | 2 +- tests/{ => mocks}/testNotification/testNotification.js | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename tests/{ => mocks}/testNotification/testNotification.js (100%) diff --git a/js/app.js b/js/app.js index ef84f44582..ffe3616df8 100644 --- a/js/app.js +++ b/js/app.js @@ -177,7 +177,7 @@ function App () { moduleFolder = defaultModuleFolder; } else { // running in Jest, allow defaultModules placed under moduleDir for testing - if (env.modulesDir === "modules" || env.modulesDir === "tests") { + if (env.modulesDir === "modules" || env.modulesDir === "tests/mocks") { moduleFolder = defaultModuleFolder; } } diff --git a/js/server.js b/js/server.js index 77fe5f2190..e61910f58b 100644 --- a/js/server.js +++ b/js/server.js @@ -72,7 +72,7 @@ function Server (config) { app.use(helmet(config.httpHeaders)); app.use("/js", express.static(__dirname)); - let directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs", "/tests/mocks", "/tests"]; + let directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests"]; for (const directory of directories) { app.use(directory, express.static(path.resolve(global.root_path + directory))); } diff --git a/tests/configs/modules/calendar/countCalendarEvents.js b/tests/configs/modules/calendar/countCalendarEvents.js index d9d370b0e3..ea3244b96d 100644 --- a/tests/configs/modules/calendar/countCalendarEvents.js +++ b/tests/configs/modules/calendar/countCalendarEvents.js @@ -2,7 +2,7 @@ let config = { address: "0.0.0.0", ipWhitelist: [], timeFormat: 12, - foreignModulesDir: "tests", + foreignModulesDir: "tests/mocks", modules: [ { module: "calendar", diff --git a/tests/testNotification/testNotification.js b/tests/mocks/testNotification/testNotification.js similarity index 100% rename from tests/testNotification/testNotification.js rename to tests/mocks/testNotification/testNotification.js From 5f2bf1e9d567ac9996cd30c613302ba244f67c5b Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 5 Jan 2025 10:30:06 -0600 Subject: [PATCH 08/11] Update calendar_spec.js remove test comment --- tests/electron/modules/calendar_spec.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index 5a9d483006..808ea73175 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -12,8 +12,7 @@ describe("Calendar module", () => { await expect(elem.isVisible()).resolves.toBe(true); return true; }; - //doTestTableContent(".testNotification tr", "td.elementCount", "12", first)).resolves.toBe(true); - + const doTestCount = async (locator = ".calendar .event") => { expect(global.page).not.toBeNull(); const loc = await global.page.locator(locator); From e94f8506339493ac657bed50c6a1575592446db3 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 5 Jan 2025 14:05:22 -0600 Subject: [PATCH 09/11] Update server.js add back prior /tests/configs and /tests/mocks --- js/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/server.js b/js/server.js index e61910f58b..dd8b7b2e98 100644 --- a/js/server.js +++ b/js/server.js @@ -72,7 +72,7 @@ function Server (config) { app.use(helmet(config.httpHeaders)); app.use("/js", express.static(__dirname)); - let directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests"]; + let directories = ["/config", "/css", "/fonts", "/modules", "/vendor", "/translations", "/tests/configs", "/tests/mocks"]; for (const directory of directories) { app.use(directory, express.static(path.resolve(global.root_path + directory))); } From 519db56a8dfde0ce02ad2f6544e04ad7fc2c13bd Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 5 Jan 2025 14:06:25 -0600 Subject: [PATCH 10/11] Update calendar_spec.js From b7881721864116882f760fb28776d56ddd470125 Mon Sep 17 00:00:00 2001 From: sam detweiler Date: Sun, 5 Jan 2025 14:08:11 -0600 Subject: [PATCH 11/11] Update calendar_spec.js --- tests/electron/modules/calendar_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/electron/modules/calendar_spec.js b/tests/electron/modules/calendar_spec.js index 808ea73175..0cf9bec5a9 100644 --- a/tests/electron/modules/calendar_spec.js +++ b/tests/electron/modules/calendar_spec.js @@ -12,7 +12,7 @@ describe("Calendar module", () => { await expect(elem.isVisible()).resolves.toBe(true); return true; }; - + const doTestCount = async (locator = ".calendar .event") => { expect(global.page).not.toBeNull(); const loc = await global.page.locator(locator);