MCPcopy Create free account
hub / github.com/continuedev/continue / sendInputWithMockedResponse

Function sendInputWithMockedResponse

gui/src/util/test/utils.ts:77–102  ·  view source on GitHub ↗
(
  ideMessenger: MockIdeMessenger,
  input: string,
  response: ChatMessage[],
)

Source from the content-addressed store, hash-verified

75}
76
77export async function sendInputWithMockedResponse(
78 ideMessenger: MockIdeMessenger,
79 input: string,
80 response: ChatMessage[],
81): Promise<void> {
82 // Setup the mock response before any actions
83 ideMessenger.chatResponse = response;
84
85 // Wait for the editor to be in the document
86 const editor = await getMainEditor();
87
88 // Find the submit button
89 const sendButton = await getElementByTestId("submit-input-button");
90
91 // Insert content into the editor
92 await act(async () => {
93 editor.commands.insertContent(input);
94 });
95
96 await getElementByText(input);
97
98 // Click the send button
99 await act(async () => {
100 sendButton.click();
101 });
102}

Calls 3

getMainEditorFunction · 0.85
getElementByTestIdFunction · 0.85
getElementByTextFunction · 0.85

Tested by

no test coverage detected