Skip to content

Commit

Permalink
Silent I18nLink component (too noisy due to "Attempted to log "Warnin…
Browse files Browse the repository at this point in the history
…g: An update to Link inside a test was not wrapped in act(...).")
  • Loading branch information
Vadorequest committed Jan 13, 2021
1 parent 7f92123 commit e2f2273
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/components/i18n/I18nLink.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,25 @@ import I18nLink from './I18nLink';
* @group components
*/
describe('I18nLink', () => {
beforeEach(() => {
global.console = global.muteConsole();
});

const I18nLinkTest = (props) => {
const { locale = 'en', href, text = 'Text', ...rest } = props;
const {
locale = 'en',
href,
text = 'Text',
...rest
} = props;

return (
<i18nContext.Provider value={{ lang: null, locale: locale }}>
<i18nContext.Provider
value={{
lang: null,
locale: locale,
}}
>
<I18nLink
href={href}
{...rest}
Expand Down

1 comment on commit e2f2273

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.