Skip to content

Commit e2fa3b3

Browse files
committed
feat(mcp-tools): add test
1 parent eea486e commit e2fa3b3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/tools/attach-to-browser.test.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,16 @@ describe(
8181

8282
expect(content).toHaveLength(1);
8383
expect(content[0].type).toBe("text");
84-
expect(content[0].text.startsWith("❌ Error attach to browser: connect ECONNREFUSED")).toBe(true);
84+
expect(content[0].text).toContain("Error attach to browser:");
85+
86+
// Check that after error attach we still have working browser
87+
const url = "https://example.com";
88+
const navigateResult = await client.callTool({ name: "navigate", arguments: { url } });
89+
const navigateContent = navigateResult.content as Array<{ type: string; text: string }>;
90+
91+
expect(navigateResult.isError).toBe(false);
92+
expect(navigateContent[0].type).toBe("text");
93+
expect(navigateContent[0].text).toContain("✅ Successfully navigated to https://example.com");
8594
});
8695

8796
it("should attach to existing browser session", async () => {

0 commit comments

Comments
 (0)