Skip to content

Commit a53a0b3

Browse files
committed
test(ui): keep committed-session retry fixtures fully typed
1 parent 506bf5d commit a53a0b3

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

‎ui/src/pages/new-session/draft-submission-flow.test.ts‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,10 @@ describe("DraftSubmissionFlow", () => {
427427
{
428428
scenario: "the Gateway client changes",
429429
retire: ({ context }: ReturnType<typeof createDraftFixture>) => {
430-
context.gateway.snapshot.client = {
431-
recoveryScope: "replacement-principal",
432-
recoveryScopeReady: true,
433-
request: vi.fn(async () => ({})),
434-
} as NonNullable<ApplicationContext["gateway"]["snapshot"]["client"]>;
430+
const client = context.gateway.snapshot.client;
431+
if (client) {
432+
context.gateway.snapshot.client = new Proxy(client, {});
433+
}
435434
},
436435
},
437436
])("never retries a committed session after $scenario", async ({ retire }) => {
@@ -445,7 +444,7 @@ describe("DraftSubmissionFlow", () => {
445444
vi.mocked(context.sessions.createResult)
446445
.mockResolvedValueOnce({ key: "agent:main:dashboard:old", initialRun: { status: "idle" } })
447446
.mockImplementationOnce(async (params) => ({
448-
key: `agent:${String(params.agentId)}:dashboard:new`,
447+
key: `agent:${params?.agentId ?? fixture.place.agentId}:dashboard:new`,
449448
initialRun: { status: "idle" },
450449
}));
451450
vi.mocked(context.navigateAndWait)

0 commit comments

Comments
 (0)