Skip to content

Commit 2df1ea9

Browse files
committed
fix: resolve Playwright test failures — DOM cleanup and aria-label HTML stripping
- Fix test cleanup: removeChild was called on already-removed container after loop, causing NotFoundError in CI - Fix NodeCard aria-label: use regex to strip HTML tags from label so aria-label contains plain text only (e.g. 'SFO Edge Router' not '<b>SFO</b> Edge Router')
1 parent ddc63e4 commit 2df1ea9

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

src/components/network/NodeCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function NodeCard({
149149
}}
150150
role="button"
151151
tabIndex={0}
152-
aria-label={`Node: ${node.label ?? node.id}`}
152+
aria-label={`Node: ${(node.label ?? node.id).replace(/<[^>]*>/g, '')}`}
153153
>
154154
{/* Header */}
155155
<div className="flex items-start justify-between gap-3 border-b border-[#ece5d8] px-4 py-3">

tests/e2e/xss-sanitization.spec.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,6 @@ test.describe("XSS Sanitization — NodeCard rendering", () => {
110110
document.body.removeChild(container);
111111
}
112112

113-
// Final cleanup
114-
document.body.removeChild(container);
115113
window.__XSS_TEST__ = false;
116114

117115
return results;

0 commit comments

Comments
 (0)