fix(quick-260921-jt4): zwei Schaltflaechenreihen tragen role="toolbar" (D-03)
calculator-widget.tsx Speicherzeile und favorites-widget.tsx
Ansichtsumschalter waren schlichte <div> mit aria-label, das die Rolle
generic stillschweigend verwarf. role="toolbar" ergaenzt (geprueft
sauber; role="group"/"region" loesen useSemanticElements neu aus).
Taschenrechner: fest verdrahteter Text wandert in
calculator.memoryLabel; bei dieser Gelegenheit auch Anzeigefeld
(displayLabel) und Rueckschritt-Taste (backspaceLabel) in den Katalog
gezogen (D-05), da diese Datei ohnehin geaendert wird.
Favoriten: die bisherige Beschriftung ("Favoriten") war sachlich
falsch fuer einen Listen/Kachel-Umschalter — neuer, zutreffender
Schluessel favorites.viewModeLabel statt des wiederverwendeten
favorites.name.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TPPB4ApQxzSU1rwV2Ffj9J
This commit is contained in:
@@ -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<string, string> = {
|
||||
'calculator.name': 'Taschenrechner',
|
||||
'calculator.displayLabel': 'Anzeige',
|
||||
'calculator.memoryLabel': 'Speicherfunktionen',
|
||||
'calculator.backspaceLabel': 'Rückschritt',
|
||||
};
|
||||
return map[key] ?? key;
|
||||
},
|
||||
}));
|
||||
|
||||
// Must import after mocks
|
||||
|
||||
Reference in New Issue
Block a user