diff --git a/frontend/src/lib/document/DescriptionSection.svelte b/frontend/src/lib/document/DescriptionSection.svelte index 3e4f12b3..59584959 100644 --- a/frontend/src/lib/document/DescriptionSection.svelte +++ b/frontend/src/lib/document/DescriptionSection.svelte @@ -78,7 +78,7 @@ const titleValue = $derived(titleDirty ? currentTitle : suggestedTitle || curren class="block w-full rounded border border-line p-2 text-sm shadow-sm focus:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring" /> {#if showTitleHelp} -

+

{m.form_helper_title_autogenerated()}

{/if} diff --git a/frontend/src/lib/document/DescriptionSection.svelte.spec.ts b/frontend/src/lib/document/DescriptionSection.svelte.spec.ts index bc47a98a..a2754a76 100644 --- a/frontend/src/lib/document/DescriptionSection.svelte.spec.ts +++ b/frontend/src/lib/document/DescriptionSection.svelte.spec.ts @@ -1,6 +1,7 @@ import { afterEach, describe, expect, it } from 'vitest'; import { cleanup, render } from 'vitest-browser-svelte'; import DescriptionSection from './DescriptionSection.svelte'; +import { m } from '$lib/paraglide/messages.js'; afterEach(() => cleanup()); @@ -57,11 +58,13 @@ describe('DescriptionSection — onMount seeding (Felix B1/B2 fix regression fen }); describe('DescriptionSection — auto-generated title helper (FR-TITLE-005)', () => { - it('shows the helper and wires aria-describedby when showTitleHelp is set', async () => { + it('shows the helper with the localized text and wires aria-describedby when showTitleHelp is set', async () => { render(DescriptionSection, { showTitleHelp: true }); const help = document.querySelector('#title-help') as HTMLElement; expect(help).not.toBeNull(); - expect(help.textContent?.trim().length ?? 0).toBeGreaterThan(0); + expect(help.textContent?.trim()).toBe(m.form_helper_title_autogenerated()); + // ≥14px for the 60+ audience (FR-005 prefers a larger size than the 12px field hints). + expect(help.classList.contains('text-sm')).toBe(true); const titleInput = document.querySelector('input#title') as HTMLInputElement; expect(titleInput.getAttribute('aria-describedby')).toBe('title-help'); });