diff --git a/.lantern/map/test/e2e.lantern b/.lantern/map/test/e2e.lantern index 63cffea..6c1814b 100644 --- a/.lantern/map/test/e2e.lantern +++ b/.lantern/map/test/e2e.lantern @@ -47,7 +47,7 @@ test/e2e/graph-navigation.spec.ts . test 0910cf6edfbd #feature file-graph = test/e2e/support/graph-harness.ts -test/e2e/graph-pixi.spec.ts . test b75dd27e683c +test/e2e/graph-pixi.spec.ts . test 661b9b4dc1e3 #feature file-graph = test/e2e/support/graph-harness.ts @@ -123,12 +123,14 @@ test/e2e/text-select.spec.ts . test b09fe6828137 = src/renderer/lib/lanternview.ts#mountLanternView = test/fixtures/graph/pr-review-demo.ts#prReviewDemo -test/e2e/tsconfig.json . config b024315ec7d5 +test/e2e/tsconfig.json . config 20fb9354fd10 < playwright.config.ts < src/main/filecontent.ts < src/main/lantern-prfile.ts < src/main/lantern-types.ts < src/main/lantern.ts + < src/main/skill-scripts.d.ts < src/renderer/global.d.ts + < src/renderer/svg.d.ts < test/helpers/lantern-map.ts < tsconfig.json diff --git a/.lantern/prs/35.pr b/.lantern/prs/35.pr new file mode 100644 index 0000000..c59db18 --- /dev/null +++ b/.lantern/prs/35.pr @@ -0,0 +1,26 @@ +lantern-pr 1 +# 35 +#title fix: type-check the e2e specs clean +#url https://github.com/MobileReality/lantern/pull/35 +#branch fix/e2e-typecheck-green +#base main +#opened 2026-11-12 +#head cf67f57134b4d52fcc4907cdcf253d7f4135e0da +#describe what The e2e typecheck now passes: its tsconfig includes the existing svg and skill-script declarations, and one spec uses the typed toBitmap. +#describe before pnpm run test:graph:typecheck failed with about 64 errors. +#describe after It exits zero with no suppressions. +#describe verified test:graph:typecheck, typecheck, lint, graph-pixi e2e (14 passed). +~ test/e2e/graph-pixi.spec.ts +~ test/e2e/tsconfig.json +#order test/e2e/tsconfig.json +#order test/e2e/graph-pixi.spec.ts +#reason test/e2e/graph-pixi.spec.ts getBitmap is typed void in Electron's types; toBitmap returns the Buffer the checks need. +#reason test/e2e/tsconfig.json Lets the e2e typecheck see the svg and skill-script declarations the main tsconfig already has. +#story Type-checking the graph specs +#step actor A developer +#file test/e2e/tsconfig.json +#step action runs the graph spec typecheck +#step subject the e2e specs +#file test/e2e/graph-pixi.spec.ts +#below interaction Trust a green typecheck for the specs +#below consequence The typecheck failed with many errors => The typecheck passes diff --git a/test/e2e/graph-pixi.spec.ts b/test/e2e/graph-pixi.spec.ts index 04dc8f1..b126e14 100644 --- a/test/e2e/graph-pixi.spec.ts +++ b/test/e2e/graph-pixi.spec.ts @@ -38,8 +38,8 @@ test('repaints retained cards when platform tabs change their column width', asy if (!freshCanvasBox) throw new Error('Pixi canvas is not visible'); const fresh = await page.screenshot({ path: testInfo.outputPath('fresh.png'), clip: { ...comparisonClip, x: freshCanvasBox.x, y: freshCanvasBox.y } }); const difference = await harness.app.evaluate(({ nativeImage }, images) => { - const navigatedBitmap = nativeImage.createFromBuffer(Buffer.from(images.navigated, 'base64')).getBitmap(); - const freshBitmap = nativeImage.createFromBuffer(Buffer.from(images.fresh, 'base64')).getBitmap(); + const navigatedBitmap = nativeImage.createFromBuffer(Buffer.from(images.navigated, 'base64')).toBitmap(); + const freshBitmap = nativeImage.createFromBuffer(Buffer.from(images.fresh, 'base64')).toBitmap(); let channelDelta = 0; for (let index = 0; index < freshBitmap.length; index += 1) channelDelta += Math.abs(navigatedBitmap[index] - freshBitmap[index]); return channelDelta / freshBitmap.length / 255; @@ -433,7 +433,7 @@ test('matches all four relation edge styles and highlights the canvas node under await page.mouse.move(canvasBox.x + 4, canvasBox.y + 4); const stable = await canvas.screenshot(); const pixels = await harness.app.evaluate(({ nativeImage }, images) => { - const bitmap = (image: string) => nativeImage.createFromBuffer(Buffer.from(image, 'base64')).getBitmap(); + const bitmap = (image: string) => nativeImage.createFromBuffer(Buffer.from(image, 'base64')).toBitmap(); return { highlighted: bitmap(images.highlighted).equals(bitmap(images.cleared)), stable: bitmap(images.stable).equals(bitmap(images.cleared)), @@ -505,8 +505,8 @@ test('keeps cached tile text consistent with freshly rendered tiles after zoomin await expect(host).toHaveAttribute('style', zoomedWidth!); const fresh = await canvas.screenshot({ path: testInfo.outputPath('fresh.png') }); const difference = await harness.app.evaluate(({ nativeImage }, images) => { - const before = nativeImage.createFromBuffer(Buffer.from(images.before, 'base64')).getBitmap(); - const after = nativeImage.createFromBuffer(Buffer.from(images.after, 'base64')).getBitmap(); + const before = nativeImage.createFromBuffer(Buffer.from(images.before, 'base64')).toBitmap(); + const after = nativeImage.createFromBuffer(Buffer.from(images.after, 'base64')).toBitmap(); if (before.length !== after.length) return 1; let changed = 0; for (let index = 0; index < before.length; index += 1) if (before[index] !== after[index]) changed += 1; diff --git a/test/e2e/tsconfig.json b/test/e2e/tsconfig.json index 073d00a..3334aa5 100644 --- a/test/e2e/tsconfig.json +++ b/test/e2e/tsconfig.json @@ -13,6 +13,8 @@ "../../src/main/filecontent.ts", "../../src/main/lantern-prfile.ts", "../../src/renderer/global.d.ts", + "../../src/renderer/svg.d.ts", + "../../src/main/skill-scripts.d.ts", "../../src/renderer/lib/**/*.ts" ] }