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:
parent
0987dcc33a
commit
9a084abb72
1 changed files with 2 additions and 2 deletions
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Reference in a new issue