Skip to content

Commit

Permalink
chore: better comment
Browse files Browse the repository at this point in the history
  • Loading branch information
vonovak committed Mar 13, 2023
1 parent e53823a commit d19665d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/I18nProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,13 @@ describe("I18nProvider", () => {
renderCount++
return <span data-testid="child">{i18n.locale}</span>
}

/**
* Note that we're doing exactly what the description says:
* but to simulate the equivalent situation, we pass our own mock subscriber
* to i18n.on("change", ...) and then we call i18n.activate("cs") ourselves
* to i18n.on("change", ...) and in it we call i18n.activate("cs") ourselves
* so that the condition in useEffect() is met and the component re-renders
* */

const mockSubscriber = jest.fn(() => {
i18n.load("cs", {})
i18n.activate("cs")
Expand Down

0 comments on commit d19665d

Please sign in to comment.