test(coach): strip step markup until stable

This commit is contained in:
Marc-André Bombeck committed 2026-09-27 15:45:14 +02:00
1 parent 5ab157a908
commit 98f2875f8e
1 file changed
+6 -3
@@ -241,9 +241,12 @@ describe("<CoachTurnStepList>", () => {
expect(html).toContain('data-status="done"');
expect(html).toContain('data-status="empty"');
expect(html).toContain('data-status="running"');
const text = html
.replace(/<span class="sr-only">, <\/span>/g, "")
.replace(/<[^>]+>/g, "");
let text = html.replace(/<span class="sr-only">, <\/span>/g, "");
// Strip tags until nothing changes, so no fragment can survive one pass.
for (let prev = ""; prev !== text;) {
prev = text;
text = text.replace(/<[^>]*>/g, "");
}
expect(text).toContain("Blood pressure · last 90 days · 142 readings");
expect(text).toContain("Sleep · last 30 days · no readings");
expect(text).toContain("Lab results · last 12 months");