test(workforce): spell out the non-breaking space the tiles contain

Intl renders en-ZA currency and numbers with U+00A0, so the tile helpers
normalise it before asserting. Written as a literal that byte is
invisible in the source and easy to "fix" into a plain space by accident.
An explicit escape says what it means.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
DEls 2026-10-10 00:15:05 +02:00
parent 0987dcc33a
commit 9a084abb72

View file

@ -25,13 +25,13 @@ const events = [
/** Tile value text for a KPI label, with Intl's non-breaking spaces normalised. */
function tileValue(html: string, label: string): string {
const match = html.match(new RegExp(`${label}[\\s\\S]*?<div class="text-2xl[^>]*>([^<]*)</div>`));
return (match?.[1] ?? "").replace(/ /g, " ");
return (match?.[1] ?? "").replace(/\u00a0/g, " ");
}
/** Sub-line text for a KPI label. */
function tileSub(html: string, label: string): string {
const match = html.match(new RegExp(`${label}[\\s\\S]*?text-muted-foreground">([^<]*)</p>`));
return (match?.[1] ?? "").replace(/ /g, " ");
return (match?.[1] ?? "").replace(/\u00a0/g, " ");
}
const ada = {