Skip to content

Commit 7a03b0c

Browse files
committed
test: use rendered node viewport assertion
Amp-Thread-ID: https://ampcode.com/threads/T-01a01ca8-8281-759a-84ba-1665d58a0c82
1 parent 5a2d47d commit 7a03b0c

2 files changed

Lines changed: 2 additions & 16 deletions

File tree

browser_tests/fixtures/utils/litegraphUtils.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -356,20 +356,6 @@ export class NodeReference {
356356
const nodeSize = await this.getSize()
357357
return { x: nodePos.x + nodeSize.width / 2, y: nodePos.y - 15 }
358358
}
359-
async waitForTitleInView(): Promise<void> {
360-
const canvas = await this.comfyPage.canvas.boundingBox()
361-
if (!canvas) throw new Error('Canvas bounding box not available')
362-
363-
let previousX = Number.NaN
364-
await expect
365-
.poll(async () => {
366-
const { x } = await this.getTitlePosition()
367-
const settledInView = x === previousX && x < canvas.width
368-
previousX = x
369-
return settledInView
370-
})
371-
.toBe(true)
372-
}
373359
async dragBy(
374360
delta: Position,
375361
options?: {

browser_tests/tests/subgraph/subgraphCreationBoundaryLinks.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ test(
2929
// view, so clicking its title silently misses and the selection is left
3030
// holding KSampler alone.
3131
await comfyPage.command.executeCommand('Comfy.Canvas.FitView')
32-
const vaeDecode = await comfyPage.nodeOps.getNodeRefById('8')
33-
await vaeDecode.waitForTitleInView()
32+
const vaeDecode = await comfyPage.vueNodes.getFixtureByTitle('VAE Decode')
33+
await expect(vaeDecode.header).toBeInViewport({ ratio: 1 })
3434

3535
await comfyPage.nodeOps.selectNodes(['KSampler', 'VAE Decode'])
3636
expect(

0 commit comments

Comments
 (0)