test: cover four small primitives

RelationshipPill: label render, empty-string handling.
OverflowPillDisplay: +N rendering, +0 edge case, aria-hidden marker.
TimelineYAxis: max/0 labels, barAreaHeight inline style, zero handling.
TranscriptionSection: heading + textarea, initial-value hydration,
empty default.

11 tests across four small primitives.

Refs #496.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-10 00:51:03 +02:00
committed by marcel
parent bdcf813e71
commit fbff5d9bd2
4 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import { describe, it, expect, afterEach } from 'vitest';
import { cleanup, render } from 'vitest-browser-svelte';
import OverflowPillDisplay from './OverflowPillDisplay.svelte';
afterEach(cleanup);
describe('OverflowPillDisplay', () => {
it('renders the +N count', async () => {
render(OverflowPillDisplay, { props: { extraCount: 3 } });
const span = document.querySelector('span') as HTMLElement;
expect(span.textContent?.trim()).toBe('+3');
});
it('renders +0 when extraCount is 0', async () => {
render(OverflowPillDisplay, { props: { extraCount: 0 } });
const span = document.querySelector('span') as HTMLElement;
expect(span.textContent?.trim()).toBe('+0');
});
it('marks the pill as aria-hidden (decorative)', async () => {
render(OverflowPillDisplay, { props: { extraCount: 5 } });
const span = document.querySelector('span') as HTMLElement;
expect(span.getAttribute('aria-hidden')).toBe('true');
});
});