Skip to content

Commit

Permalink
chore: 馃敡 added i18n mock to generators (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonsolokha96 authored and Can-Sahin committed Jan 18, 2021
1 parent 4b8788c commit 2440250
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions internals/generators/component/index.test.tsx.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ import { render } from '@testing-library/react';

import { {{ properCase ComponentName }} } from '..';

{{#if wantTranslations}}
jest.mock('react-i18next', () => ({
useTranslation: () => {
return {
t: str => str,
i18n: {
changeLanguage: () => new Promise(() => {}),
},
};
},
}));
{{/if}}

describe('<{{ properCase ComponentName }} />', () => {
it('should match snapshot', () => {
const loadingIndicator = render(<{{ properCase ComponentName }} />);
Expand Down

0 comments on commit 2440250

Please sign in to comment.