fix: remove setTimeout anti-patterns in test fixtures

Remove redundant setTimeout calls inside page.evaluate() in SubgraphHelper.ts.

The waits were unnecessary since proper Playwright waitForSelector calls already exist after the evaluate returns.

Amp-Thread-ID: https://ampcode.com/threads/T-019c134d-cf30-7028-aca7-cfc6227c90ef
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Alexander Brown
2026-01-31 01:17:40 -08:00
parent b01426be5d
commit b7986ae5f6

View File

@@ -1,7 +1,7 @@
import type { Page } from '@playwright/test'
import type { ComfyPage } from '../ComfyPage'
import type { NodeReference} from '../utils/litegraphUtils';
import type { NodeReference } from '../utils/litegraphUtils'
import { SubgraphSlotReference } from '../utils/litegraphUtils'
export class SubgraphHelper {
@@ -88,14 +88,6 @@ export class SubgraphHelper {
app.canvas.pointer,
app.canvas.linkConnector
)
}
// Wait briefly for menu to appear
await new Promise((resolve) => setTimeout(resolve, 100))
// Check if context menu appeared
const menuExists = document.querySelector('.litemenu-entry')
if (menuExists) {
return {
success: true,
slotName: slot.name,
@@ -136,9 +128,6 @@ export class SubgraphHelper {
}
}
// Wait briefly for dialog to appear
await new Promise((resolve) => setTimeout(resolve, 200))
return { success: true, slotName: slot.name, x: testX, y: testY }
}