import React from "react"; import TestRenderer from "react-test-renderer"; import { FluentBundle, FluentResource } from "@fluent/bundle"; import { ReactLocalization, LocalizationProvider, Localized, } from "../src/index.ts"; test("relocalizes", () => { const Root = ({ l10n }) => (
); const bundle1 = new FluentBundle(); bundle1.addResource( new FluentResource(` foo = FOO `) ); const renderer = TestRenderer.create( ); expect(renderer.toJSON()).toMatchInlineSnapshot(`
FOO
`); const bundle2 = new FluentBundle(); bundle2.addResource( new FluentResource(` foo = BAR `) ); renderer.update(); expect(renderer.toJSON()).toMatchInlineSnapshot(`
BAR
`); });