fix electron tests mocking dates (#3599)

fixes #3597 

Changes:
- electron tests: add mocking to `electron.js` for mocking the server
side, before only the browser side was mocked
- publish "/tests/configs" and "/tests/mocks" always in `server.js`,
this reverts a change done with latest release, we need this for
debugging (otherwise you get on the screen that your config has errors
but config check is successful ...)
- revert hotfix in
`tests/configs/modules/calendar/show-duplicates-in-calendar.js`
- fix `tests/configs/modules/calendar/custom.js` to allow events in the
past (~~I don't know how this could work before~~ when testing css
classes `yesterday` and `dayBeforeYesterday` --> it worked before
because the server side did not mock and therefore was not in the past)
This commit is contained in:
Karsten Hassel
2024-10-25 11:34:35 +02:00
committed by GitHub
parent 6946b49977
commit cfa5c0d127
6 changed files with 26 additions and 10 deletions

View File

@@ -8,6 +8,10 @@ exports.startApplication = async (configFilename, systemDate = null, electronPar
global.page = null;
process.env.MM_CONFIG_FILE = configFilename;
process.env.TZ = timezone;
if (systemDate) {
process.env.MOCK_DATE = systemDate;
}
global.electronApp = await electron.launch({ args: electronParams });
await global.electronApp.firstWindow();
@@ -34,6 +38,7 @@ exports.stopApplication = async () => {
}
global.electronApp = null;
global.page = null;
process.env.MOCK_DATE = undefined;
};
exports.getElement = async (selector) => {