fix: remove unused ts-expect-error and fix flaky drag test

- Remove stale @ts-expect-error in imagePreviewStore.test.ts (createMockNode
  now accepts Record<string, unknown> so animatedImages is valid)
- Add waitFor + nextFrame in interaction.spec.ts beforeEach to let canvas
  settle after UseNewMenu layout shift

Amp-Thread-ID: https://ampcode.com/threads/T-019c7313-f15a-707b-94a5-33f473a8dad5
This commit is contained in:
bymyself
2026-02-18 19:30:51 -08:00
parent a6fd4c517a
commit f7ba2fb177
2 changed files with 3 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ import type { NodeReference } from '../fixtures/utils/litegraphUtils'
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.settings.setSetting('Comfy.UseNewMenu', 'Disabled')
// Wait for the legacy menu to appear and canvas to settle after layout shift.
await comfyPage.page.locator('.comfy-menu').waitFor({ state: 'visible' })
await comfyPage.nextFrame()
})
test.describe('Item Interaction', { tag: ['@screenshot', '@node'] }, () => {

View File

@@ -161,7 +161,6 @@ describe('imagePreviewStore getPreviewParam', () => {
it('should return empty string if node.animatedImages is true', () => {
const store = useNodeOutputStore()
// @ts-expect-error `animatedImages` property is not typed
const node = createMockNode({ animatedImages: true })
const outputs = createMockOutputs([{ filename: 'img.png' }])
expect(store.getPreviewParam(node, outputs)).toBe('')