diff --git a/apps/web/src/components/dashboard/widgets/calculator-widget.test.tsx b/apps/web/src/components/dashboard/widgets/calculator-widget.test.tsx index 6514190..ce53642 100644 --- a/apps/web/src/components/dashboard/widgets/calculator-widget.test.tsx +++ b/apps/web/src/components/dashboard/widgets/calculator-widget.test.tsx @@ -1,9 +1,19 @@ import { render, screen, fireEvent } from '@testing-library/react'; import { describe, expect, it, vi } from 'vitest'; -// Mock next-intl — returns the key so tests are locale-agnostic +// Mock next-intl — returns the real de.json strings for the few keys this +// widget actually renders as accessible names/labels, the raw key otherwise +// (locale-agnostic fallback for anything not explicitly mapped here). vi.mock('next-intl', () => ({ - useTranslations: () => (key: string) => key, + useTranslations: () => (key: string) => { + const map: Record = { + 'calculator.name': 'Taschenrechner', + 'calculator.displayLabel': 'Anzeige', + 'calculator.memoryLabel': 'Speicherfunktionen', + 'calculator.backspaceLabel': 'Rückschritt', + }; + return map[key] ?? key; + }, })); // Must import after mocks diff --git a/apps/web/src/components/dashboard/widgets/calculator-widget.tsx b/apps/web/src/components/dashboard/widgets/calculator-widget.tsx index 56c61b9..f137571 100644 --- a/apps/web/src/components/dashboard/widgets/calculator-widget.tsx +++ b/apps/web/src/components/dashboard/widgets/calculator-widget.tsx @@ -336,13 +336,15 @@ export function CalculatorWidget({ isEditMode }: WidgetProps) { {/* Display */} {display} - {/* Memory row */} -
+ {/* Memory row — role="toolbar" (D-03): ohne Rolle ist das
generic + und die Vorlesehilfe verwirft aria-label stillschweigend. Geprueft + sauber (role="group"/"region" loesen useSemanticElements neu aus). */} +
@@ -356,7 +358,7 @@ export function CalculatorWidget({ isEditMode }: WidgetProps) { applyUnary('percent')} /> - + {/* Row 2: unary + divide */} applyUnary('reciprocal')} /> diff --git a/apps/web/src/components/dashboard/widgets/favorites-widget.tsx b/apps/web/src/components/dashboard/widgets/favorites-widget.tsx index fb8220f..804bdf8 100644 --- a/apps/web/src/components/dashboard/widgets/favorites-widget.tsx +++ b/apps/web/src/components/dashboard/widgets/favorites-widget.tsx @@ -263,7 +263,16 @@ export function FavoritesWidget({
{/* View mode toggle (edit mode only) */} {isEditMode && ( -
+ // role="toolbar" (D-03): die bisherige Beschriftung ("Favoriten") + // war sachlich falsch fuer einen Umschalter zwischen Listen- und + // Kachelansicht — hier greift D-03 im Sinn des Streichens (die + // Beschriftung trug keine echte Bedeutung), eine richtige + // Beschriftung ist trotzdem besser als gar keine. +