mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-11-29 10:24:20 +01:00
7d83d6454f
This commit aims to put a testing environment in place for frontend react components using the de-facto standards for our stack. An example test file was writter for the component plan-form.tsx. Some fixtures for some API endpoints were written (see __setup__/server.js)
12 lines
295 B
JavaScript
12 lines
295 B
JavaScript
jest.mock('react-i18next', () => ({
|
|
// this mock makes sure any components using the translate hook can use it without a warning being shown
|
|
useTranslation: () => {
|
|
return {
|
|
t: (str) => str,
|
|
i18n: {
|
|
changeLanguage: () => new Promise(() => {})
|
|
}
|
|
};
|
|
}
|
|
}));
|