test(persons): assert the card title by exact message, not regex
All checks were successful
CI / Unit & Component Tests (pull_request) Successful in 3m18s
CI / OCR Service Tests (pull_request) Successful in 25s
CI / Backend Unit Tests (pull_request) Successful in 3m36s
CI / fail2ban Regex (pull_request) Successful in 46s
CI / Semgrep Security Scan (pull_request) Successful in 22s
CI / Compose Bucket Idempotency (pull_request) Successful in 1m4s

toHaveAttribute compares by equality, so passing a regex asserted against
the literal RegExp object and failed. Assert the full title against
m.person_correspondents_search_title(...) instead — it names both persons
and avoids retyping the copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-06-03 08:17:51 +02:00
parent ed7b19fac0
commit aa13e40bd6

View File

@@ -73,9 +73,14 @@ describe('CoCorrespondentsList', () => {
}
});
// Asserted against the de message (names both persons) — not retyped copy.
const link = page.getByRole('link', { name: /max mustermann/i });
await expect.element(link).toHaveAttribute('title', /Anna Schmidt/);
await expect.element(link).toHaveAttribute('title', /Max Mustermann/);
await expect
.element(link)
.toHaveAttribute(
'title',
m.person_correspondents_search_title({ A: 'Anna Schmidt', B: 'Max Mustermann' })
);
});
it('builds initials from up to two name parts', async () => {