test: stabilize asynchronous integration checks (#44787)

This commit is contained in:
Kit Langton
2026-08-24 18:02:13 -04:00
committed by GitHub
parent 8be467de8d
commit 42d160f4a0
3 changed files with 8 additions and 11 deletions
+2 -9
View File
@@ -12,13 +12,7 @@ describe("acp service prompt routing and usage", () => {
return Response.json({ data: makeSession("ses_routes") })
}
if (request.method === "POST" && request.path === "/api/session/ses_routes/command") {
const id = requestID(request)
completeTurn(context, "ses_routes", {
id: `evt_${id}`,
type: "session.inbox.delivered",
data: { sessionID: "ses_routes", inboxID: id },
})
return Response.json({ data: {} })
return new Response(null, { status: 204 })
}
if (request.method === "POST" && request.path === "/api/session/ses_routes/skill") {
const id = requestID(request)
@@ -65,9 +59,8 @@ describe("acp service prompt routing and usage", () => {
const skill = fixture.requests.find((request) => request.path === "/api/session/ses_routes/skill")
const compact = fixture.requests.find((request) => request.path === "/api/session/ses_routes/compact")
expect(command?.body).toMatchObject({
id: expect.any(String),
command: "review",
arguments: "now",
text: "now",
files: [],
delivery: "steer",
})
@@ -201,7 +201,7 @@ test("reflows held tabs when the pointer leaves the strip", async () => {
await app.mockMouse.moveTo(0, 1)
await app.mockMouse.moveTo(20, 0)
await app.waitForFrame((frame) => Array.from(frame.split("\n")[0] ?? "")[20] === "✕")
await app.waitForFrame((frame) => Array.from(frame.split("\n")[0] ?? "")[20] === "✕", { maxPasses: 100 })
expect(Array.from(app.captureCharFrame().split("\n")[0] ?? "")[22]).not.toBe("✕")
} finally {
app.renderer.destroy()
@@ -263,7 +263,11 @@ test("stores session tabs for the current working directory by default", async (
try {
const file = path.join(setup.state, "test", "tui", "tabs.json")
await wait(() => Bun.file(file).size > 0)
await wait(async () => {
if (!(await Bun.file(file).exists())) return false
const stored = await Bun.file(file).json()
return stored.cwd[directory]?.tabs.some((tab: { sessionID: string }) => tab.sessionID === "first")
})
const stored = await Bun.file(file).json()
expect(stored.global).toEqual({ tabs: [], unread: {} })
expect(Object.keys(stored.cwd)).toEqual([directory])