From dc9b0e39365d563dd90372b6a2fde4a54a256017 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Sun, 4 Oct 2026 16:14:47 +0200 Subject: [PATCH] test(import): read the note's text without a tag-stripping replace --- .../apple-health-own-records-note.test.tsx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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("", () => {