Skip to content

Commit bd6940b

Browse files
test(web): chat shortcut test types through the composer handle (#23126)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 70e5e38 commit bd6940b

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

‎apps/web/src/components/chat/useChatShortcuts.browser.test.tsx‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { expect, it } from "vite-plus/test";
33
import { userEvent } from "vite-plus/test/browser";
44

55
import { render } from "../../../test/render";
6+
import type { ChatComposerHandle } from "./ChatComposer";
67
import { useChatShortcuts } from "./useChatShortcuts";
78

89
const shortcutContext = {
@@ -50,10 +51,16 @@ function Chat(props: { composerKeys: string[]; launcher?: { keys: string; receiv
5051
scriptKeybindings: [],
5152
getShortcutContext: () => shortcutContext,
5253
threadFindActive: false,
53-
typeIntoComposer: (key) => {
54-
props.composerKeys.push(key);
55-
return true;
54+
// Type-to-focus only calls insertTextAtEnd, so the stand-in composer implements just that.
55+
composerRef: {
56+
current: {
57+
insertTextAtEnd: (key: string) => {
58+
props.composerKeys.push(key);
59+
return true;
60+
},
61+
} as Partial<ChatComposerHandle> as ChatComposerHandle,
5662
},
63+
branchToolbarRef: { current: null },
5764
closeThreadFind: () => {},
5865
commands: {},
5966
fallback: () => undefined,

0 commit comments

Comments
 (0)