From 36f7bdad45265d60e788079be9dda100b2d9160a Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 13 Jun 2026 22:30:56 +0200 Subject: [PATCH] test(document): fence RANGE end-date reveal before DatePrecisionField extraction Adds a RANGE-reveal regression test to WhoWhenSection's spec. The existing spec covered only date pre-fill / hideDate / location, leaving the end-date region without a red signal. This must stay green across the #781 extraction of DatePrecisionField into $lib/shared/primitives/. Refs #781 Co-Authored-By: Claude Opus 4.8 --- .../src/lib/document/WhoWhenSection.svelte.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/frontend/src/lib/document/WhoWhenSection.svelte.spec.ts b/frontend/src/lib/document/WhoWhenSection.svelte.spec.ts index a1b26628..e38a0969 100644 --- a/frontend/src/lib/document/WhoWhenSection.svelte.spec.ts +++ b/frontend/src/lib/document/WhoWhenSection.svelte.spec.ts @@ -39,4 +39,17 @@ describe('WhoWhenSection — onMount seeding (Felix B1 fix regression fence)', ( const locationInput = document.querySelector('input#location') as HTMLInputElement; expect(locationInput.value).toBe('Berlin'); }); + + // Regression fence for the DatePrecisionField extraction (#781): the existing + // spec covered only date pre-fill / hideDate / location, so the RANGE end-date + // reveal had no red signal. This test must stay green across the extraction. + it('reveals the end-date field when precision is RANGE', async () => { + render(WhoWhenSection, { precision: 'RANGE' }); + await expect.element(page.getByLabelText('Enddatum')).toBeVisible(); + }); + + it('hides the end-date field when precision is not RANGE', async () => { + render(WhoWhenSection, { precision: 'YEAR' }); + await expect.element(page.getByTestId('who-when-end-date')).not.toBeInTheDocument(); + }); });