♻️(e2e) improve config testcases

Improve config testcases:
- let THEME_CUSTOMIZATION_FILE_PATH to be set to
check the default value
- add helper function overrideConfig
This commit is contained in:
Anthony LC
2025-05-13 11:24:02 +02:00
parent 2733785016
commit 310154815b
4 changed files with 37 additions and 65 deletions

View File

@@ -22,6 +22,24 @@ export const CONFIG = {
theme_customization: {},
};
export const overrideConfig = async (
page: Page,
newConfig: { [K in keyof typeof CONFIG]?: unknown },
) =>
await page.route('**/api/v1.0/config/', async (route) => {
const request = route.request();
if (request.method().includes('GET')) {
await route.fulfill({
json: {
...CONFIG,
...newConfig,
},
});
} else {
await route.continue();
}
});
export const keyCloakSignIn = async (
page: Page,
browserName: string,