mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-13 14:32:03 +00:00
test: pin the Coach layout clock to midday and read copied text without a tag-stripping replace
The panel groups conversations by the browser's local day, so the e2e fixture's "an hour ago" landed in yesterday when CI ran just after midnight. The turn-steps test reads its markup by splitting rather than with a replace CodeQL reads as an incomplete sanitiser.
This commit is contained in:
1 parent
68720418e3
commit
ef9dc1ddc6
2 files changed
+10
-6
No files matched your search
@@ -363,12 +363,12 @@ describe("a step row copied out of the list", () => {
|
||||
"de",
|
||||
);
|
||||
// What a selection copies: every text node except the unselectable ones.
|
||||
// Reads this test's own static markup; not a sanitiser for input.
|
||||
const copied = html
|
||||
.replace(
|
||||
/<span[^>]*class="[^"]*\bselect-none\b[^"]*"[^>]*>[^<]*<\/span>/g,
|
||||
"",
|
||||
)
|
||||
.replace(/<[^>]+>/g, "")
|
||||
.split(/<span[^>]*class="[^"]*\bselect-none\b[^"]*"[^>]*>[^<]*<\/span>/)
|
||||
.join("")
|
||||
.split(/<[^>]*>/)
|
||||
.join("")
|
||||
.replace(/\s+/g, " ")
|
||||
.trim();
|
||||
expect(copied).toBe("Gewicht · letzte 90 Tage");
|
||||
|
||||
Reference in new issue
Block a user