Public Access
test: component tests with jsdom and Testing Library
First tests cover the library search debounce (fails on the old looping version), the Pile of Shame states and the backlog save body. jsdom is enabled per test file, so the plain util tests stay in the node environment.
This commit is contained in:
1 parent
c24c22d5ed
commit
bad11807e0
6 files changed
+918
No files matched your search
@@ -0,0 +1,6 @@
|
||||
// Module mock for react-i18next: t() returns the key (plus ":<count>" for plurals), so tests do not depend on the texts.
|
||||
// Use in a test file: vi.mock('react-i18next', () => import('../test/i18n-mock.js'));
|
||||
const t = (key, options) => (options?.count === undefined ? key : `${key}:${options.count}`);
|
||||
const i18n = {language: 'de'};
|
||||
|
||||
export const useTranslation = () => ({t, i18n});
|
||||
Reference in new issue
Block a user