[fix] Revert test changes - tests should use event.key format

This commit is contained in:
snomiao
2025-09-30 05:59:23 +00:00
parent e5adc840fe
commit 14255b3512
2 changed files with 9 additions and 13 deletions

View File

@@ -12,7 +12,7 @@ import {
} from '@/stores/keybindingStore'
// Mock stores
vi.mock('@/platform/settings/settingStore', () => ({
vi.mock('@/stores/settingStore', () => ({
useSettingStore: vi.fn(() => ({
get: vi.fn(() => [])
}))
@@ -66,7 +66,7 @@ describe('keybindingService - Escape key handling', () => {
it('should execute ExitSubgraph command when Escape is pressed', async () => {
const event = new KeyboardEvent('keydown', {
code: 'Escape',
key: 'Escape',
bubbles: true,
cancelable: true
})
@@ -83,7 +83,7 @@ describe('keybindingService - Escape key handling', () => {
it('should not execute command when Escape is pressed with modifiers', async () => {
const event = new KeyboardEvent('keydown', {
code: 'Escape',
key: 'Escape',
ctrlKey: true,
bubbles: true,
cancelable: true
@@ -100,7 +100,7 @@ describe('keybindingService - Escape key handling', () => {
it('should not execute command when typing in input field', async () => {
const inputElement = document.createElement('input')
const event = new KeyboardEvent('keydown', {
code: 'Escape',
key: 'Escape',
bubbles: true,
cancelable: true
})
@@ -130,7 +130,7 @@ describe('keybindingService - Escape key handling', () => {
document.body.appendChild(dialog)
const event = new KeyboardEvent('keydown', {
code: 'Escape',
key: 'Escape',
bubbles: true,
cancelable: true
})
@@ -158,7 +158,7 @@ describe('keybindingService - Escape key handling', () => {
)
const event = new KeyboardEvent('keydown', {
code: 'Escape',
key: 'Escape',
bubbles: true,
cancelable: true
})
@@ -185,7 +185,7 @@ describe('keybindingService - Escape key handling', () => {
keybindingService = useKeybindingService()
const event = new KeyboardEvent('keydown', {
code: 'Escape',
key: 'Escape',
bubbles: true,
cancelable: true
})