Elffuss BraidHub

kikocis/continue public

fix: tests
Changeset910f9a39164f88f98cbd21a557da7cb0130ac8952f3ea64b3bd04aadd3ef21b0
AuthorNate <sestinj@gmail.com> · 2025-09-14 18:44 -07:00
CommitterNate <sestinj@gmail.com> · 2025-09-14 18:44 -07:00
Parents9c8f3520bf15

Browse the files at this changeset

1 file changed

modified gui/src/redux/thunks/streamResponse_toolCalls.test.ts +36 −22
@@ -563,18 +563,25 @@
563563 expect(result.type).toBe("chat/streamResponse/fulfilled");
564564
565565 // Verify telemetry events for auto-approved tool execution
566- expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_decision", {
567- decision: "auto_accept",
568- toolName: "search_codebase",
569- toolCallId: "tool-call-1",
570- });
566+ // Use partial matching to allow additional fields (e.g. model) in payload
567+ expect(mockPosthog.capture).toHaveBeenCalledWith(
568+ "gui_tool_call_decision",
569+ expect.objectContaining({
570+ decision: "auto_accept",
571+ toolName: "search_codebase",
572+ toolCallId: "tool-call-1",
573+ }),
574+ );
571575
572- expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_outcome", {
573- succeeded: true,
574- toolName: "search_codebase",
575- errorMessage: undefined,
576- duration_ms: expect.any(Number),
577- });
576+ expect(mockPosthog.capture).toHaveBeenCalledWith(
577+ "gui_tool_call_outcome",
578+ expect.objectContaining({
579+ succeeded: true,
580+ toolName: "search_codebase",
581+ errorMessage: undefined,
582+ duration_ms: expect.any(Number),
583+ }),
584+ );
578585
579586 // Verify final state after tool call execution
580587 const finalState = mockStoreWithToolSettings.getState();
@@ -2800,18 +2807,25 @@
28002807 ]);
28012808
28022809 // Verify telemetry events for manual approval flow
2803- expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_decision", {
2804- decision: "accept",
2805- toolName: "search_codebase",
2806- toolCallId: "tool-approval-flow-1",
2807- });
2810+ // Use partial matching to allow additional fields (e.g. model) in payload
2811+ expect(mockPosthog.capture).toHaveBeenCalledWith(
2812+ "gui_tool_call_decision",
2813+ expect.objectContaining({
2814+ decision: "accept",
2815+ toolName: "search_codebase",
2816+ toolCallId: "tool-approval-flow-1",
2817+ }),
2818+ );
28082819
2809- expect(mockPosthog.capture).toHaveBeenCalledWith("gui_tool_call_outcome", {
2810- succeeded: true,
2811- toolName: "search_codebase",
2812- errorMessage: undefined,
2813- duration_ms: expect.any(Number),
2814- });
2820+ expect(mockPosthog.capture).toHaveBeenCalledWith(
2821+ "gui_tool_call_outcome",
2822+ expect.objectContaining({
2823+ succeeded: true,
2824+ toolName: "search_codebase",
2825+ errorMessage: undefined,
2826+ duration_ms: expect.any(Number),
2827+ }),
2828+ );
28152829
28162830 // Verify IDE messenger calls for tool execution
28172831 expect(mockIdeMessengerApproval.request).toHaveBeenCalledWith(