fix: address PR review feedback for subgraph test suite

- Tighten queue response assertion to response.ok() (subgraphNested)
- Use ControlOrMeta for cross-platform copy/paste (subgraphOperations)
- Use RENAMED_LABEL in post-rename locator assertion (subgraphSlots)
- Wrap Alt key drag in try/finally to prevent leaks (subgraphCrud)
- Add comment explaining double nextFrame intent (subgraphSlots)

Amp-Thread-ID: https://ampcode.com/threads/T-019d40d8-0fd2-72b2-9422-607306079abd
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Alexander Brown
2026-03-30 15:45:34 -07:00
parent 7cb2eb07a0
commit d95c224193
4 changed files with 13 additions and 9 deletions

View File

@@ -18,12 +18,15 @@ test.describe('Subgraph CRUD', { tag: ['@slow', '@subgraph'] }, () => {
await comfyPage.page.mouse.move(subgraphPos.x + 16, subgraphPos.y + 16)
await comfyPage.page.keyboard.down('Alt')
await comfyPage.page.mouse.down()
await comfyPage.nextFrame()
try {
await comfyPage.page.mouse.down()
await comfyPage.nextFrame()
await comfyPage.page.mouse.move(subgraphPos.x + 64, subgraphPos.y + 64)
await comfyPage.page.mouse.up()
await comfyPage.page.keyboard.up('Alt')
await comfyPage.page.mouse.move(subgraphPos.x + 64, subgraphPos.y + 64)
await comfyPage.page.mouse.up()
} finally {
await comfyPage.page.keyboard.up('Alt')
}
}
test.describe('Subgraph Unpacking', () => {

View File

@@ -25,7 +25,7 @@ test.describe('Nested Subgraphs', { tag: ['@subgraph'] }, () => {
const response = await responsePromise
expect(warnings).toEqual([])
expect(response.status()).not.toBe(400)
expect(response.ok()).toBe(true)
} finally {
dispose()
}

View File

@@ -32,10 +32,10 @@ test.describe('Subgraph Operations', { tag: ['@slow', '@subgraph'] }, () => {
await nodeToClone.click('title')
await comfyPage.nextFrame()
await comfyPage.page.keyboard.press('Control+c')
await comfyPage.page.keyboard.press('ControlOrMeta+c')
await comfyPage.nextFrame()
await comfyPage.page.keyboard.press('Control+v')
await comfyPage.page.keyboard.press('ControlOrMeta+v')
await comfyPage.nextFrame()
await expect

View File

@@ -392,7 +392,7 @@ test.describe('Subgraph Slots', { tag: ['@slow', '@subgraph'] }, () => {
})
expect(updatedLabel).toBe(RENAMED_LABEL)
const seedWidgetAfter = subgraphNodeAfter.getByLabel('seed', {
const seedWidgetAfter = subgraphNodeAfter.getByLabel(RENAMED_LABEL, {
exact: true
})
await expect(seedWidgetAfter).toBeVisible()
@@ -410,6 +410,7 @@ test.describe('Subgraph Slots', { tag: ['@slow', '@subgraph'] }, () => {
await comfyPage.workflow.loadWorkflow(
'subgraphs/subgraph-with-promoted-text-widget'
)
// Two frames needed: first renders slot changes, second stabilizes layout
await comfyPage.nextFrame()
await comfyPage.nextFrame()