diff --git a/src/components/settings/import-panel/__tests__/apple-health-own-records-note.test.tsx b/src/components/settings/import-panel/__tests__/apple-health-own-records-note.test.tsx index 9d18bd756..12b1c29c2 100644 --- a/src/components/settings/import-panel/__tests__/apple-health-own-records-note.test.tsx +++ b/src/components/settings/import-panel/__tests__/apple-health-own-records-note.test.tsx @@ -24,13 +24,18 @@ function bundle(locale: Locale): MessageBundle { } function render(locale: Locale, count: number): string { - return renderToStaticMarkup( - - - , - ) - .replace(/<[^>]+>/g, "") - .trim(); + return ( + renderToStaticMarkup( + + + , + ) + // Text between the tags; a test reading its own static markup, not a + // sanitiser for untrusted input. + .split(/<[^>]*>/) + .join("") + .trim() + ); } describe("", () => {