Skip to content

Commit 7ac1e40

Browse files
committed
Update tests
1 parent d2696e4 commit 7ac1e40

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

client/src/components/__tests__/ToolsTab.test.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ describe("ToolsTab", () => {
7171
// Switch to second tool
7272
rerender(
7373
<Tabs defaultValue="tools">
74-
<ToolsTab {...defaultProps} selectedTool={mockTools[1]} />
74+
<ToolsTab {...defaultProps} selectedTool={mockTools[2]} />
7575
</Tabs>,
7676
);
7777

@@ -82,25 +82,24 @@ describe("ToolsTab", () => {
8282

8383
it("should handle integer type inputs", () => {
8484
renderToolsTab({
85-
selectedTool: mockTools[2],
85+
selectedTool: mockTools[1], // Use the tool with integer type
8686
});
8787

8888
// Verify input is rendered as a number input
8989
const input = screen.getByRole("spinbutton") as HTMLInputElement;
90-
expect(input.type).toBe("text"); // This will fail - should be "number"
90+
expect(input.type).toBe("number"); // Integer type should be treated as number
9191

9292
// Enter an integer value
9393
fireEvent.change(input, { target: { value: "42" } });
9494
expect(input.value).toBe("42");
9595

9696
// Verify the callTool function receives the value as a number
97-
const submitButton = screen.getByRole("button", { name: /submit/i });
97+
const submitButton = screen.getByRole("button", { name: /run tool/i });
9898
fireEvent.click(submitButton);
9999

100100
expect(defaultProps.callTool).toHaveBeenCalledWith(
101-
mockTools[2].name,
102-
{ count: 42 }, // Should be number 42, not string "42"
103-
expect.any(Function)
101+
mockTools[1].name,
102+
{ count: 42 }
104103
);
105104
});
106105
});

0 commit comments

Comments
 (0)