Skip to content

Commit

Permalink
Fix test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Oct 11, 2024
1 parent 8d751cf commit 10e774b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions browser_tests/changeTracker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ test.describe('Change Tracker', () => {

await multipleChanges()

await comfyPage.ctrlZ()
await comfyPage.executeCommand('Comfy.Undo')
await expect(node).not.toBeBypassed()
await expect(node).not.toBePinned()
await expect(node).not.toBeCollapsed()

await comfyPage.ctrlY()
await comfyPage.executeCommand('Comfy.Redo')
await expect(node).toBeBypassed()
await expect(node).toBePinned()
await expect(node).toBeCollapsed()
Expand Down
2 changes: 1 addition & 1 deletion browser_tests/menu.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ test.describe('Menu', () => {
const workflowMenuItem =
await comfyPage.menu.topbar.getMenuItem('Workflow')
await workflowMenuItem.click()
const exportTag = comfyPage.page.locator('.keybinding-tag', {
const exportTag = comfyPage.page.locator('.keybinding-tag:visible', {
hasText: 'Ctrl + s'
})
expect(await exportTag.count()).toBe(1)
Expand Down
14 changes: 12 additions & 2 deletions src/stores/coreKeybindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,24 @@ export const CORE_KEYBINDINGS: Keybinding[] = [
key: 'z',
ctrl: true
},
commandId: 'Comfy.Undo'
commandId: 'Comfy.Undo',
targetSelector: '#graph-canvas'
},
{
combo: {
key: 'Z',
ctrl: true,
shift: true
},
commandId: 'Comfy.Redo'
commandId: 'Comfy.Redo',
targetSelector: '#graph-canvas'
},
{
combo: {
key: 'y',
ctrl: true
},
commandId: 'Comfy.Redo',
targetSelector: '#graph-canvas'
}
]

0 comments on commit 10e774b

Please sign in to comment.