fix(07-03): make e2e typecheck pass — add DOM lib to tsconfig.e2e, cast styleHandle el to Element

Playwright transpiles specs without typechecking (esbuild), so layout.spec.ts ran
green while `tsc -p tsconfig.e2e.json` failed: page.evaluate(() => document...)
callbacks need the DOM lib, and styleHandle.evaluate((el) => el.remove()) typed el as
Node (no .remove()). Phase 8 CI runs the typecheck gate, so this would have broken CI.
Adds DOM/DOM.Iterable to the e2e tsconfig (also covers 07-04 specs) and casts el to Element.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Lucas Berger
2026-06-11 02:06:15 -04:00
co-authored by Claude Opus 4.8
parent f8227855dc
commit 4cd7931c3c
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -208,7 +208,7 @@ test.describe('harness self-validation — injected defects', () => {
// REMOVE the injected style by navigating (page.reload drops inline style tags) // REMOVE the injected style by navigating (page.reload drops inline style tags)
// then re-measure — must be ≥ 44px again // then re-measure — must be ≥ 44px again
await styleHandle.evaluate((el) => el.remove()) await styleHandle.evaluate((el) => (el as Element).remove())
const boxAfterRemoval = await calTab.boundingBox() const boxAfterRemoval = await calTab.boundingBox()
expect( expect(
boxAfterRemoval, boxAfterRemoval,
@@ -248,7 +248,7 @@ test.describe('harness self-validation — injected defects', () => {
).toBeGreaterThan(overflowWithDefect.clientWidth) ).toBeGreaterThan(overflowWithDefect.clientWidth)
// REMOVE the injected style — overflow must clear // REMOVE the injected style — overflow must clear
await styleHandle.evaluate((el) => el.remove()) await styleHandle.evaluate((el) => (el as Element).remove())
const overflowAfterRemoval = await page.evaluate(() => ({ const overflowAfterRemoval = await page.evaluate(() => ({
scrollWidth: document.documentElement.scrollWidth, scrollWidth: document.documentElement.scrollWidth,
clientWidth: document.documentElement.clientWidth, clientWidth: document.documentElement.clientWidth,
+1 -1
View File
@@ -2,7 +2,7 @@
"extends": "./tsconfig.json", "extends": "./tsconfig.json",
"compilerOptions": { "compilerOptions": {
"types": ["node"], "types": ["node"],
"lib": ["ES2023"] "lib": ["ES2023", "DOM", "DOM.Iterable"]
}, },
"include": ["playwright.config.ts", "e2e/**/*"], "include": ["playwright.config.ts", "e2e/**/*"],
"exclude": ["node_modules"] "exclude": ["node_modules"]