diff --git a/tests/ui/pages.ui.js b/tests/ui/pages.ui.js index d7fc438..d762de4 100644 --- a/tests/ui/pages.ui.js +++ b/tests/ui/pages.ui.js @@ -49,7 +49,9 @@ test('no page shows an em or en dash (house style)', async ({ page }) => { await page.goto(p.path); await page.waitForLoadState('networkidle'); const text = await page.evaluate(() => document.title + '\n' + document.body.innerText); - const hits = text.split('\n').filter(l => /[–—]/.test(l)); + // En and em dash, built from char codes so this file itself stays dash-free. + const dash = new RegExp('[' + String.fromCharCode(0x2013, 0x2014) + ']'); + const hits = text.split('\n').filter(l => dash.test(l)); expect(hits, `${p.path} shows dashes`).toEqual([]); } });