Skip to content

Commit

Permalink
Add test for cloning pinned node (#1753)
Browse files Browse the repository at this point in the history
* Add test for cloning pinned node

* Remove only

* Update litegraph

---------

Co-authored-by: huchenlei <[email protected]>
  • Loading branch information
pythongosssss and huchenlei authored Dec 2, 2024
1 parent 9ef4018 commit 1c7f3e8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
18 changes: 18 additions & 0 deletions browser_tests/rightClickMenu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
})
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop": "^1.3.1",
"@comfyorg/comfyui-electron-types": "^0.3.19",
"@comfyorg/litegraph": "^0.8.41",
"@comfyorg/litegraph": "^0.8.42",
"@primevue/themes": "^4.0.5",
"@vueuse/core": "^11.0.0",
"@xterm/addon-fit": "^0.10.0",
Expand Down

0 comments on commit 1c7f3e8

Please sign in to comment.