mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-13 00:50:01 +00:00
Fix unbookmark node in node library (#639)
* Add unbookmark test * Fix unbookmark
This commit is contained in:
@@ -206,7 +206,7 @@ test.describe('Menu', () => {
|
||||
)
|
||||
})
|
||||
|
||||
test('Can unbookmark node', async ({ comfyPage }) => {
|
||||
test('Can unbookmark node (Top level bookmark)', async ({ comfyPage }) => {
|
||||
await comfyPage.setSetting('Comfy.NodeLibrary.Bookmarks', [
|
||||
'KSampler (Advanced)'
|
||||
])
|
||||
@@ -219,6 +219,24 @@ test.describe('Menu', () => {
|
||||
[]
|
||||
)
|
||||
})
|
||||
|
||||
test('Can unbookmark node (Library node bookmark)', async ({
|
||||
comfyPage
|
||||
}) => {
|
||||
await comfyPage.setSetting('Comfy.NodeLibrary.Bookmarks', [
|
||||
'KSampler (Advanced)'
|
||||
])
|
||||
const tab = comfyPage.menu.nodeLibraryTab
|
||||
await tab.getFolder('sampling').click()
|
||||
await comfyPage.page
|
||||
.locator(tab.nodeSelector('KSampler (Advanced)'))
|
||||
.nth(1)
|
||||
.locator('.bookmark-button')
|
||||
.click()
|
||||
expect(await comfyPage.getSetting('Comfy.NodeLibrary.Bookmarks')).toEqual(
|
||||
[]
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
test('Can change canvas zoom speed setting', async ({ comfyPage }) => {
|
||||
|
||||
@@ -30,6 +30,10 @@ export const useNodeBookmarkStore = defineStore('nodeBookmark', () => {
|
||||
const toggleBookmark = (node: ComfyNodeDefImpl) => {
|
||||
if (isBookmarked(node)) {
|
||||
deleteBookmark(node.nodePath)
|
||||
// Delete the bookmark at the top level if it exists
|
||||
// This is used for clicking the bookmark button in the node library, i.e.
|
||||
// the node is inside original/standard node library tree node
|
||||
deleteBookmark(node.display_name)
|
||||
} else {
|
||||
addBookmark(node.display_name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user