fix: sync node.imgs in Vue nodes for Copy Image compatibility

- Add syncNodeImgs() to ImagePreview.vue to sync node.imgs on image load
- Simplify setupNodeForMaskEditor() to reuse sync logic
- Add aria-label to MaskEditorButton for accessibility
- Add browser test for mask editor button functionality
- Add unit test for node.imgs sync behavior

Fixes copy image and other legacy features that rely on node.imgs
This commit is contained in:
bymyself
2025-12-12 18:45:05 -08:00
parent db7beb6e9f
commit 9d4974e4ec
3 changed files with 14 additions and 12 deletions

View File

@@ -25,7 +25,9 @@ test.describe('Vue Nodes Mask Editor', () => {
waitForUpload: true
})
await comfyPage.page.waitForTimeout(500)
// Wait for image preview to appear
const imagePreview = comfyPage.page.locator('.image-preview img')
await expect(imagePreview).toBeVisible()
const maskEditorDialog = comfyPage.page.locator('.maskEditor-dialog-root')
@@ -33,9 +35,9 @@ test.describe('Vue Nodes Mask Editor', () => {
await comfyPage.selectNodes(['Load Image'])
await expect(comfyPage.selectionToolbox).toBeVisible()
const toolboxMaskButton = comfyPage.page.locator(
'.selection-toolbox button:has(.i-comfy\\:mask)'
)
const toolboxMaskButton = comfyPage.selectionToolbox.getByRole('button', {
name: /mask editor/i
})
await expect(toolboxMaskButton).toBeVisible()
await toolboxMaskButton.click()