58 lines
1.2 KiB
TypeScript
58 lines
1.2 KiB
TypeScript
import { expect, type Page } from '@playwright/test';
|
|
|
|
export const renderedRoutes = [
|
|
'/',
|
|
'/platform',
|
|
'/pricing',
|
|
'/contact',
|
|
'/trust',
|
|
'/legal',
|
|
'/privacy',
|
|
'/terms',
|
|
'/imprint',
|
|
'/welcome-to-docs/',
|
|
] as const;
|
|
|
|
export const redirectRoutes = [
|
|
'/product',
|
|
'/products',
|
|
'/services',
|
|
'/blog',
|
|
'/insights',
|
|
] as const;
|
|
|
|
const forbiddenPublicText = [
|
|
'ScrewFast',
|
|
'construction',
|
|
'hardware',
|
|
'template',
|
|
'open-source',
|
|
'TenantAtlas',
|
|
'TenantPilot',
|
|
'TenantCTRL',
|
|
'trusted by',
|
|
'SOC 2',
|
|
'ISO 27001',
|
|
'99.9%',
|
|
'Microsoft endorsed',
|
|
'guaranteed recovery',
|
|
'guaranteed compliance',
|
|
];
|
|
|
|
export async function expectNoForbiddenPublicText(page: Page): Promise<void> {
|
|
const text = await page.locator('body').innerText();
|
|
|
|
for (const term of forbiddenPublicText) {
|
|
expect(text.toLowerCase()).not.toContain(term.toLowerCase());
|
|
}
|
|
}
|
|
|
|
export async function expectNoHorizontalOverflow(page: Page): Promise<void> {
|
|
const metrics = await page.evaluate(() => ({
|
|
clientWidth: document.documentElement.clientWidth,
|
|
scrollWidth: document.documentElement.scrollWidth,
|
|
}));
|
|
|
|
expect(metrics.scrollWidth).toBeLessThanOrEqual(metrics.clientWidth + 1);
|
|
}
|