mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
test: Enhance sitemap tests to validate presence of dynamic sections
This commit is contained in:
@@ -49,18 +49,23 @@ test.describe("Home: Sitemap", () => {
|
||||
|
||||
// Ensure at least one dynamic section appears
|
||||
const hasBlog: boolean = locs.some((l: string) => {
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
return (/\/blog\b/).test(l);
|
||||
});
|
||||
const hasCompare: boolean = locs.some((l: string) => {
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
return (/\/compare\//).test(l);
|
||||
});
|
||||
const hasProductPages: boolean = locs.some((l: string) => {
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
return (/\/product\//).test(l);
|
||||
});
|
||||
const hasDocs: boolean = locs.some((l: string) => {
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
return (/\/docs\//).test(l);
|
||||
});
|
||||
const hasLegal: boolean = locs.some((l: string) => {
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
return (/\/legal\//).test(l);
|
||||
});
|
||||
expect(hasBlog).toBeTruthy();
|
||||
|
||||
@@ -40,7 +40,7 @@ const HomeFeatureSet: FeatureSet = {
|
||||
res.locals["homeUrl"] = (await DatabaseConfig.getHomeUrl())
|
||||
.toString()
|
||||
.replace(/\/$/, "");
|
||||
} catch (_err) {
|
||||
} catch {
|
||||
// Fallback hard-coded production domain if env misconfigured
|
||||
res.locals["homeUrl"] = "https://oneuptime.com";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user