fix(coding-agent): make tests keybinding-agnostic
Reset global editor keybindings to defaults in beforeEach for session-selector-rename and tree-selector tests. Pass KeybindingsManager.inMemory() to SessionSelectorComponent in tests to avoid reading user keybindings.json. Closes #2360
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { beforeAll, describe, expect, test } from "vitest";
|
||||
import { DEFAULT_EDITOR_KEYBINDINGS, EditorKeybindingsManager, setEditorKeybindings } from "@mariozechner/pi-tui";
|
||||
import { beforeAll, beforeEach, describe, expect, test } from "vitest";
|
||||
import type {
|
||||
ModelChangeEntry,
|
||||
SessionEntry,
|
||||
@@ -12,6 +13,11 @@ beforeAll(() => {
|
||||
initTheme("dark");
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
// Ensure test isolation: editor keybindings are a global singleton
|
||||
setEditorKeybindings(new EditorKeybindingsManager(DEFAULT_EDITOR_KEYBINDINGS));
|
||||
});
|
||||
|
||||
// Helper to create a user message entry
|
||||
function userMessage(id: string, parentId: string | null, content: string): SessionMessageEntry {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user