test: Update tests to use event.code format for keyboard shortcuts

- Update keybinding tests to use event.code instead of event.key
- Add forwarding test for keybinding service
- Align tests with the fix for non-English keyboard layouts

This ensures tests match the application's use of event.code for
language-independent keyboard shortcut handling.
This commit is contained in:
snomiao
2025-10-01 03:26:24 +00:00
parent 82a603ef03
commit 692666ff63
6 changed files with 184 additions and 4 deletions

View File

@@ -290,7 +290,7 @@ test.describe('Settings', () => {
const expectedSetting: Keybinding = {
commandId: 'Comfy.NewBlankWorkflow',
combo: {
key: 'KeyN',
key: 'n',
ctrl: false,
alt: true,
shift: false

View File

@@ -69,7 +69,7 @@ test.describe('Topbar commands', () => {
],
keybindings: [
{
combo: { key: 'KeyK' },
combo: { key: 'k' },
commandId: 'TestCommand'
}
]

View File

@@ -2,6 +2,10 @@ import { expect } from '@playwright/test'
import { comfyPageFixture as test } from '../fixtures/ComfyPage'
test.beforeEach(async ({ comfyPage }) => {
await comfyPage.setSetting('Comfy.UseNewMenu', 'Disabled')
})
test.describe('Keybindings', () => {
test('Should not trigger non-modifier keybinding when typing in input fields', async ({
comfyPage

View File

@@ -727,7 +727,7 @@ test.describe('Subgraph Operations', () => {
{
commandId: 'Comfy.Graph.ExitSubgraph',
combo: {
key: 'KeyQ',
key: 'q',
ctrl: false,
alt: true,
shift: false