diff --git a/www/tools/service-portal.test.mjs b/www/tools/service-portal.test.mjs index 39a3daf..45c912f 100644 --- a/www/tools/service-portal.test.mjs +++ b/www/tools/service-portal.test.mjs @@ -45,6 +45,18 @@ test('portal presentation translates only explicit button tokens/brand fills and assert.equal(portalLinkPresentation([], '', 'tel:'), 'portal-contact-link'); }); +test('staff template presentation follows sanitized headings, not original HubSpot classes', async () => { + const renderer = await fs.readFile('src/scripts/employee-portal.ts', 'utf8'); + const css = await fs.readFile('src/components/pages/EmployeePortal.astro', 'utf8'); + assert.match(renderer, /enhanceStaffPortalPresentation\(output\)/); + assert.match(renderer, /'management templates'/); + assert.match(renderer, /fragment\.querySelectorAll\('a\[href\]'\)/); + assert.match(renderer, /templatesList\?\.classList\.add\('portal-template-grid'\)/); + assert.match(css, /grid-template-columns: repeat\(2, minmax\(0, 1fr\)\)/); + assert.match(css, /@media \(max-width: 767px\)/); + assert.match(css, /ul\.portal-template-grid a\.portal-resource-button/); +}); + test('global preference validates expiry, corrupted values and clock anomalies', () => { const now = 10000000000; for (const raw of [null, '', 'NaN', '-1', '1.5', 'Infinity', String(now), String(now - 1), String(now + suppressionDuration + 1)]) assert.equal(isSuppressed(raw, now), false);