test(coverage): drive browser tests to 80% on all metrics (#496) #505

Merged
marcel merged 189 commits from feat/issue-496-browser-coverage-tests into main 2026-05-11 21:50:39 +02:00
Showing only changes of commit 02df15c460 - Show all commits

View File

@@ -70,4 +70,30 @@ describe('CoCorrespondentsList', () => {
await expect.element(page.getByText('MM')).toBeVisible();
});
it('handles a single-word name (initials use just one letter)', async () => {
render(CoCorrespondentsList, {
props: {
coCorrespondents: [{ id: 'c-1', name: 'Cher', count: 2 }],
personId: 'p-1'
}
});
// "Cher" → initials "C"
const initialsBadge = document.querySelector('span.flex.h-4.w-4');
expect(initialsBadge?.textContent?.trim()).toBe('C');
});
it('handles a name part starting with empty string gracefully', async () => {
render(CoCorrespondentsList, {
props: {
coCorrespondents: [{ id: 'c-1', name: ' Max', count: 1 }],
personId: 'p-1'
}
});
// Leading space → name.split(' ') yields ['', '', 'Max']; first chars are '', '', 'M' → 'M'
const initialsBadge = document.querySelector('span.flex.h-4.w-4');
expect(initialsBadge?.textContent?.trim()).toContain('M');
});
});