mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 20:42:43 +00:00
test(coach): strip step markup until stable
This commit is contained in:
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");
|
||||
|
||||
Reference in new issue
Block a user