Fix unit tests to match current implementation

- Add timeout parameter to all executeSwiftCli calls
- Update image tool tests to include --capture-focus parameter
- All tests now pass (206 passed, 65 skipped as expected)

Fixes failing CI tests in Node.js 20.x environment.
This commit is contained in:
codegen-sh[bot] 2025-06-08 05:50:10 +00:00
parent 7b8b7f5fe1
commit 4b9ab04878

View file

@ -146,6 +146,7 @@ describe("List Tool", () => {
expect(mockExecuteSwiftCli).toHaveBeenCalledWith(
["list", "apps"],
mockLogger,
expect.objectContaining({ timeout: expect.any(Number) })
);
expect(result.content[0].text).toContain("Found 2 running applications");
expect(result.content[0].text).toContain(
@ -205,6 +206,7 @@ describe("List Tool", () => {
"ids,bounds,off_screen",
],
mockLogger,
expect.objectContaining({ timeout: expect.any(Number) })
);
expect(result.content[0].text).toContain(
"Found 2 windows for application: Safari (com.apple.Safari) - PID: 1234",
@ -767,6 +769,7 @@ describe("List Tool", () => {
expect(mockExecuteSwiftCli).toHaveBeenCalledWith(
["list", "windows", "--app", "TestApp"],
mockLogger,
expect.objectContaining({ timeout: expect.any(Number) })
);
expect(result.content[0].text).toContain('"Test Window"');
});