diff --git a/apps/web/src/components/dashboard/widgets/note-widget.test.tsx b/apps/web/src/components/dashboard/widgets/note-widget.test.tsx new file mode 100644 index 0000000..da62ebc --- /dev/null +++ b/apps/web/src/components/dashboard/widgets/note-widget.test.tsx @@ -0,0 +1,202 @@ +import { act, render, screen } from '@testing-library/react'; +import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; + +// Mock next-intl +vi.mock('next-intl', () => ({ + useTranslations: () => (key: string) => { + const map: Record = { + 'note.defaultTitle': 'Notiz', + 'note.autosaveError': 'Speichern fehlgeschlagen', + }; + return map[key] ?? key; + }, +})); + +// Mock @uiw/react-md-editor — provide a minimal textarea-based substitute +vi.mock('@uiw/react-md-editor', () => { + const MDEditor = ({ + value, + onChange, + 'data-testid': testId, + }: { + value?: string; + onChange?: (val?: string) => void; + 'data-testid'?: string; + }) => ( +