Add test for cloning pinned node (#1753)

* Add test for cloning pinned node

* Remove only

* Update litegraph

---------

Co-authored-by: huchenlei <huchenlei@proton.me>
This commit is contained in:
pythongosssss
2024-12-02 03:38:09 +00:00
committed by GitHub
parent 9ef40189f9
commit 1c7f3e865a
3 changed files with 23 additions and 5 deletions

View File

@@ -186,4 +186,22 @@ test.describe('Node Right Click Menu', () => {
'selected-nodes-unpinned.png'
)
})
test('Can clone pinned nodes', async ({ comfyPage }) => {
const nodeCount = await comfyPage.getGraphNodesCount()
const node = (await comfyPage.getFirstNodeRef())!
await node.clickContextMenuOption('Pin')
await comfyPage.nextFrame()
await node.click('title', { button: 'right' })
await expect(
comfyPage.page.locator('.litemenu-entry:has-text("Unpin")')
).toBeAttached()
const cloneItem = comfyPage.page.locator(
'.litemenu-entry:has-text("Clone")'
)
await cloneItem.click()
await expect(cloneItem).toHaveCount(0)
await comfyPage.nextFrame()
expect(await comfyPage.getGraphNodesCount()).toBe(nodeCount + 1)
})
})