Skip to content

Commit 037bda6

Browse files
committed
electron tests: fix setup to run with xserver and labwc, remove electronParams from calendar_spec.js
1 parent 5e337f8 commit 037bda6

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ planned for 2025-04-01
2626
### Fixed
2727

2828
- [calendar] fix clipping events being broadcast (#3678)
29-
- [tests] Electron tests: Fixes for running under new github image ubuntu-24.04, replace xserver with labwc (#3676)
29+
- [tests] Electron tests: Fixes for running under new github image ubuntu-24.04, replace xserver with labwc, running under xserver and labwc depending on env variable WAYLAND_DISPLAY is set (#3676)
3030
- [calendar] fix arrayed symbols, #3267, again, add testcase, add testcase for #3678
3131

3232
## [2.30.0] - 2025-01-01

tests/electron/helpers/global-setup.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ exports.startApplication = async (configFilename, systemDate = null, electronPar
1313
}
1414
process.env.mmTestMode = "true";
1515

16-
electronParams.unshift("js/electron.js", "--enable-features=UseOzonePlatform", "--ozone-platform=wayland");
16+
// check environment for DISPLAY or WAYLAND_DISPLAY
17+
if (process.env.WAYLAND_DISPLAY !== "") {
18+
electronParams.unshift("js/electron.js", "--enable-features=UseOzonePlatform", "--ozone-platform=wayland");
19+
} else {
20+
electronParams.unshift("js/electron.js");
21+
}
1722

1823
global.electronApp = await electron.launch({ args: electronParams });
1924

tests/electron/modules/calendar_spec.js

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("Calendar module", () => {
8181
*/
8282
describe("rrule", () => {
8383
it("Issue #3393 recurrence dates past rrule until date", async () => {
84-
await helpers.startApplication("tests/configs/modules/calendar/rrule_until.js", "07 Mar 2024 10:38:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
84+
await helpers.startApplication("tests/configs/modules/calendar/rrule_until.js", "07 Mar 2024 10:38:00 GMT-07:00", [], "America/Los_Angeles");
8585
await expect(doTestCount()).resolves.toBe(1);
8686
});
8787
});
@@ -98,20 +98,20 @@ describe("Calendar module", () => {
9898
*/
9999
describe("Exdate: LA crossover DST before midnight GMT", () => {
100100
it("LA crossover DST before midnight GMT should have 2 events", async () => {
101-
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_before_midnight.js", "19 Oct 2023 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
101+
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_before_midnight.js", "19 Oct 2023 12:30:00 GMT-07:00", [], "America/Los_Angeles");
102102
await expect(doTestCount()).resolves.toBe(2);
103103
});
104104
});
105105

106106
describe("Exdate: LA crossover DST at midnight GMT local STD", () => {
107107
it("LA crossover DST before midnight GMT should have 2 events", async () => {
108-
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_at_midnight_std.js", "19 Oct 2023 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
108+
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_at_midnight_std.js", "19 Oct 2023 12:30:00 GMT-07:00", [], "America/Los_Angeles");
109109
await expect(doTestCount()).resolves.toBe(2);
110110
});
111111
});
112112
describe("Exdate: LA crossover DST at midnight GMT local DST", () => {
113113
it("LA crossover DST before midnight GMT should have 2 events", async () => {
114-
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_at_midnight_dst.js", "19 Oct 2023 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
114+
await helpers.startApplication("tests/configs/modules/calendar/exdate_la_at_midnight_dst.js", "19 Oct 2023 12:30:00 GMT-07:00", [], "America/Los_Angeles");
115115
await expect(doTestCount()).resolves.toBe(2);
116116
});
117117
});
@@ -128,19 +128,19 @@ describe("Calendar module", () => {
128128
*/
129129
describe("Exdate: SYD crossover DST before midnight GMT", () => {
130130
it("LA crossover DST before midnight GMT should have 2 events", async () => {
131-
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_before_midnight.js", "14 Sep 2023 12:30:00 GMT+10:00", ["js/electron.js"], "Australia/Sydney");
131+
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_before_midnight.js", "14 Sep 2023 12:30:00 GMT+10:00", [], "Australia/Sydney");
132132
await expect(doTestCount()).resolves.toBe(2);
133133
});
134134
});
135135
describe("Exdate: SYD crossover DST at midnight GMT local STD", () => {
136136
it("LA crossover DST before midnight GMT should have 2 events", async () => {
137-
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_at_midnight_std.js", "14 Sep 2023 12:30:00 GMT+10:00", ["js/electron.js"], "Australia/Sydney");
137+
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_at_midnight_std.js", "14 Sep 2023 12:30:00 GMT+10:00", [], "Australia/Sydney");
138138
await expect(doTestCount()).resolves.toBe(2);
139139
});
140140
});
141141
describe("Exdate: SYD crossover DST at midnight GMT local DST", () => {
142142
it("SYD crossover DST at midnight GMT local DST should have 2 events", async () => {
143-
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_at_midnight_dst.js", "14 Sep 2023 12:30:00 GMT+10:00", ["js/electron.js"], "Australia/Sydney");
143+
await helpers.startApplication("tests/configs/modules/calendar/exdate_syd_at_midnight_dst.js", "14 Sep 2023 12:30:00 GMT+10:00", [], "Australia/Sydney");
144144
await expect(doTestCount()).resolves.toBe(2);
145145
});
146146
});
@@ -151,7 +151,7 @@ describe("Calendar module", () => {
151151
*/
152152
describe("sliceMultiDayEvents", () => {
153153
it("Issue #3452 split multiday in Europe", async () => {
154-
await helpers.startApplication("tests/configs/modules/calendar/sliceMultiDayEvents.js", "01 Sept 2024 10:38:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
154+
await helpers.startApplication("tests/configs/modules/calendar/sliceMultiDayEvents.js", "01 Sept 2024 10:38:00 GMT+02:00", [], "Europe/Berlin");
155155
expect(global.page).not.toBeNull();
156156
const loc = await global.page.locator(".calendar .event");
157157
const elem = loc.first();
@@ -164,80 +164,80 @@ describe("Calendar module", () => {
164164

165165
describe("sliceMultiDayEvents direct count", () => {
166166
it("Issue #3452 split multiday in Europe", async () => {
167-
await helpers.startApplication("tests/configs/modules/calendar/sliceMultiDayEvents.js", "01 Sept 2024 10:38:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
167+
await helpers.startApplication("tests/configs/modules/calendar/sliceMultiDayEvents.js", "01 Sept 2024 10:38:00 GMT+02:00", [], "Europe/Berlin");
168168
await expect(doTestCount()).resolves.toBe(6);
169169
});
170170
});
171171

172172
describe("germany timezone", () => {
173173
it("Issue #unknown fullday timezone East of UTC edge", async () => {
174-
await helpers.startApplication("tests/configs/modules/calendar/germany_at_end_of_day_repeating.js", "01 Oct 2024 10:38:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
174+
await helpers.startApplication("tests/configs/modules/calendar/germany_at_end_of_day_repeating.js", "01 Oct 2024 10:38:00 GMT+02:00", [], "Europe/Berlin");
175175
await expect(doTestTableContent(".calendar .event", ".time", "Oct 22nd, 23:00", first)).resolves.toBe(true);
176176
});
177177
});
178178

179179
describe("germany all day repeating moved (recurrence and exdate)", () => {
180180
it("Issue #unknown fullday timezone East of UTC event moved", async () => {
181-
await helpers.startApplication("tests/configs/modules/calendar/3_move_first_allday_repeating_event.js", "01 Oct 2024 10:38:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
181+
await helpers.startApplication("tests/configs/modules/calendar/3_move_first_allday_repeating_event.js", "01 Oct 2024 10:38:00 GMT+02:00", [], "Europe/Berlin");
182182
await expect(doTestTableContent(".calendar .event", ".time", "12th.Oct")).resolves.toBe(true);
183183
});
184184
});
185185

186186
describe("chicago late in timezone", () => {
187187
it("Issue #unknown rrule US close to timezone edge", async () => {
188-
await helpers.startApplication("tests/configs/modules/calendar/chicago_late_in_timezone.js", "01 Sept 2024 10:38:00 GMT-5:00", ["js/electron.js"], "America/Chicago");
188+
await helpers.startApplication("tests/configs/modules/calendar/chicago_late_in_timezone.js", "01 Sept 2024 10:38:00 GMT-5:00", [], "America/Chicago");
189189
await expect(doTestTableContent(".calendar .event", ".time", "10th.Sep, 20:15")).resolves.toBe(true);
190190
});
191191
});
192192

193193
describe("berlin late in day event moved, viewed from berlin", () => {
194194
it("Issue #unknown rrule ETC+2 close to timezone edge", async () => {
195-
await helpers.startApplication("tests/configs/modules/calendar/end_of_day_berlin_moved.js", "08 Oct 2024 12:30:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
195+
await helpers.startApplication("tests/configs/modules/calendar/end_of_day_berlin_moved.js", "08 Oct 2024 12:30:00 GMT+02:00", [], "Europe/Berlin");
196196
await expect(doTestTableContent(".calendar .event", ".time", "24th.Oct, 23:00-00:00", last)).resolves.toBe(true);
197197
});
198198
});
199199

200200
describe("berlin late in day event moved, viewed from sydney", () => {
201201
it("Issue #unknown rrule ETC+2 close to timezone edge", async () => {
202-
await helpers.startApplication("tests/configs/modules/calendar/end_of_day_berlin_moved.js", "08 Oct 2024 12:30:00 GMT+02:00", ["js/electron.js"], "Australia/Sydney");
202+
await helpers.startApplication("tests/configs/modules/calendar/end_of_day_berlin_moved.js", "08 Oct 2024 12:30:00 GMT+02:00", [], "Australia/Sydney");
203203
await expect(doTestTableContent(".calendar .event", ".time", "25th.Oct, 01:00-02:00", last)).resolves.toBe(true);
204204
});
205205
});
206206

207207
describe("berlin late in day event moved, viewed from chicago", () => {
208208
it("Issue #unknown rrule ETC+2 close to timezone edge", async () => {
209-
await helpers.startApplication("tests/configs/modules/calendar/end_of_day_berlin_moved.js", "08 Oct 2024 12:30:00 GMT+02:00", ["js/electron.js"], "America/Chicago");
209+
await helpers.startApplication("tests/configs/modules/calendar/end_of_day_berlin_moved.js", "08 Oct 2024 12:30:00 GMT+02:00", [], "America/Chicago");
210210
await expect(doTestTableContent(".calendar .event", ".time", "24th.Oct, 16:00-17:00", last)).resolves.toBe(true);
211211
});
212212
});
213213

214214
describe("berlin multi-events inside offset", () => {
215215
it("some events before DST. some after midnight", async () => {
216-
await helpers.startApplication("tests/configs/modules/calendar/berlin_multi.js", "08 Oct 2024 12:30:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
216+
await helpers.startApplication("tests/configs/modules/calendar/berlin_multi.js", "08 Oct 2024 12:30:00 GMT+02:00", [], "Europe/Berlin");
217217
await expect(doTestTableContent(".calendar .event", ".time", "30th.Oct, 00:00-01:00", last)).resolves.toBe(true);
218218
await expect(doTestTableContent(".calendar .event", ".time", "21st.Oct, 00:00-01:00", first)).resolves.toBe(true);
219219
});
220220
});
221221

222222
describe("berlin whole day repeating, start moved after end", () => {
223223
it("some events before DST. some after", async () => {
224-
await helpers.startApplication("tests/configs/modules/calendar/berlin_whole_day_event_moved_over_dst_change.js", "08 Oct 2024 12:30:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
224+
await helpers.startApplication("tests/configs/modules/calendar/berlin_whole_day_event_moved_over_dst_change.js", "08 Oct 2024 12:30:00 GMT+02:00", [], "Europe/Berlin");
225225
await expect(doTestTableContent(".calendar .event", ".time", "30th.Oct", last)).resolves.toBe(true);
226226
await expect(doTestTableContent(".calendar .event", ".time", "27th.Oct", first)).resolves.toBe(true);
227227
});
228228
});
229229

230230
describe("berlin 11pm-midnight", () => {
231231
it("right inside the offset, before midnight", async () => {
232-
await helpers.startApplication("tests/configs/modules/calendar/berlin_end_of_day_repeating.js", "08 Oct 2024 12:30:00 GMT+02:00", ["js/electron.js"], "Europe/Berlin");
232+
await helpers.startApplication("tests/configs/modules/calendar/berlin_end_of_day_repeating.js", "08 Oct 2024 12:30:00 GMT+02:00", [], "Europe/Berlin");
233233
await expect(doTestTableContent(".calendar .event", ".time", "24th.Oct, 23:00-00:00", last)).resolves.toBe(true);
234234
await expect(doTestTableContent(".calendar .event", ".time", "22nd.Oct, 23:00-00:00", first)).resolves.toBe(true);
235235
});
236236
});
237237

238238
describe("both moved and delete events in recurring list", () => {
239239
it("with moved before and after original", async () => {
240-
await helpers.startApplication("tests/configs/modules/calendar/exdate_and_recurrence_together.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Los_Angeles");
240+
await helpers.startApplication("tests/configs/modules/calendar/exdate_and_recurrence_together.js", "08 Oct 2024 12:30:00 GMT-07:00", [], "America/Los_Angeles");
241241
// moved after end at oct 26
242242
await expect(doTestTableContent(".calendar .event", ".time", "27th.Oct, 14:30-15:30", last)).resolves.toBe(true);
243243
// moved before start at oct 23
@@ -249,39 +249,39 @@ describe("Calendar module", () => {
249249

250250
describe("one event diff tz", () => {
251251
it("start/end in diff timezones", async () => {
252-
await helpers.startApplication("tests/configs/modules/calendar/diff_tz_start_end.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Chicago");
252+
await helpers.startApplication("tests/configs/modules/calendar/diff_tz_start_end.js", "08 Oct 2024 12:30:00 GMT-07:00", [], "America/Chicago");
253253
// just
254254
await expect(doTestTableContent(".calendar .event", ".time", "29th.Oct, 05:00-30th.Oct, 18:00", first)).resolves.toBe(true);
255255
});
256256
});
257257

258258
describe("one event non repeating", () => {
259259
it("fullday non-repeating", async () => {
260-
await helpers.startApplication("tests/configs/modules/calendar/fullday_event_over_multiple_days_nonrepeating.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Chicago");
260+
await helpers.startApplication("tests/configs/modules/calendar/fullday_event_over_multiple_days_nonrepeating.js", "08 Oct 2024 12:30:00 GMT-07:00", [], "America/Chicago");
261261
// just
262262
await expect(doTestTableContent(".calendar .event", ".time", "25th.Oct-30th.Oct", first)).resolves.toBe(true);
263263
});
264264
});
265265

266266
describe("one event no end display", () => {
267267
it("don't display end", async () => {
268-
await helpers.startApplication("tests/configs/modules/calendar/event_with_time_over_multiple_days_non_repeating_no_display_end.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Chicago");
268+
await helpers.startApplication("tests/configs/modules/calendar/event_with_time_over_multiple_days_non_repeating_no_display_end.js", "08 Oct 2024 12:30:00 GMT-07:00", [], "America/Chicago");
269269
// just
270270
await expect(doTestTableContent(".calendar .event", ".time", "25th.Oct, 20:00", first)).resolves.toBe(true);
271271
});
272272
});
273273

274274
describe("display end display end", () => {
275275
it("display end", async () => {
276-
await helpers.startApplication("tests/configs/modules/calendar/event_with_time_over_multiple_days_non_repeating_display_end.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Chicago");
276+
await helpers.startApplication("tests/configs/modules/calendar/event_with_time_over_multiple_days_non_repeating_display_end.js", "08 Oct 2024 12:30:00 GMT-07:00", [], "America/Chicago");
277277
// just
278278
await expect(doTestTableContent(".calendar .event", ".time", "25th.Oct, 20:00-26th.Oct, 06:00", first)).resolves.toBe(true);
279279
});
280280
});
281281

282282
describe("count and check symbols", () => {
283283
it("in array", async () => {
284-
await helpers.startApplication("tests/configs/modules/calendar/symboltest.js", "08 Oct 2024 12:30:00 GMT-07:00", ["js/electron.js"], "America/Chicago");
284+
await helpers.startApplication("tests/configs/modules/calendar/symboltest.js", "08 Oct 2024 12:30:00 GMT-07:00", [], "America/Chicago");
285285
// just
286286
await expect(doTestCount(".calendar .event .symbol .fa-fw")).resolves.toBe(2);
287287
await expect(doTestCount(".calendar .event .symbol .fa-calendar-check")).resolves.toBe(1);
@@ -292,7 +292,7 @@ describe("Calendar module", () => {
292292

293293
describe("count events broadcast", () => {
294294
it("get 12 with maxentries set to 1", async () => {
295-
await helpers.startApplication("tests/configs/modules/calendar/countCalendarEvents.js", "01 Jan 2024 12:30:00 GMT-076:00", ["js/electron.js"], "America/Chicago");
295+
await helpers.startApplication("tests/configs/modules/calendar/countCalendarEvents.js", "01 Jan 2024 12:30:00 GMT-076:00", [], "America/Chicago");
296296
await expect(doTestTableContent(".testNotification", ".elementCount", "12", first)).resolves.toBe(true);
297297
});
298298
});

0 commit comments

Comments
 (0)