mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-05 22:25:36 +00:00
Check HTML-encoded quotes when handling translations for embedded pages (such as welcome.html) (#30743)
* Check HTML encoding on embedded page * Add tests * lint
This commit is contained in:
@@ -19,10 +19,10 @@ jest.mock("../../../../../src/languageHandler", () => ({
|
||||
}));
|
||||
|
||||
describe("<EmbeddedPage />", () => {
|
||||
it("should translate _t strings", async () => {
|
||||
it.each([`"`, `'`, `'`, `4`])("should translate _t strings", async (character) => {
|
||||
mocked(_t).mockReturnValue("Przeglądaj pokoje");
|
||||
fetchMock.get("https://home.page", {
|
||||
body: '<h1>_t("Explore rooms")</h1>',
|
||||
body: `<h1>_t(${character}Explore rooms${character})</h1>`,
|
||||
});
|
||||
|
||||
const { asFragment } = render(<EmbeddedPage url="https://home.page" />);
|
||||
|
||||
Reference in New Issue
Block a user