test(persons): assert the card title by exact message, not regex
All checks were successful
CI / Unit & Component Tests (push) Successful in 3m13s
CI / OCR Service Tests (push) Successful in 23s
CI / Backend Unit Tests (push) Successful in 3m36s
CI / fail2ban Regex (push) Successful in 44s
CI / Semgrep Security Scan (push) Successful in 21s
CI / Compose Bucket Idempotency (push) 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 was merged in pull request #721.
This commit is contained in:
Marcel
2026-06-03 08:17:51 +02:00
committed by marcel
parent 2bf14aeab9
commit caea0d5633

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 () => {