From 9e10e274cca11786cec84e783ee2f5de3ecd9808 Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Sun, 26 Jul 2026 13:49:57 +0200 Subject: [PATCH] test: set the steer default explicitly in the queue tests Four useSteering tests went tautological once the default flipped to queue. Seeding duringRunDefaultAction keeps them covering the guard they were written for. --- .../hooks/Chat/__tests__/useSteering.spec.tsx | 25 ++++++++++++++++--- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/client/src/hooks/Chat/__tests__/useSteering.spec.tsx b/client/src/hooks/Chat/__tests__/useSteering.spec.tsx index 401f7a13b3..6a34d3c899 100644 --- a/client/src/hooks/Chat/__tests__/useSteering.spec.tsx +++ b/client/src/hooks/Chat/__tests__/useSteering.spec.tsx @@ -116,7 +116,11 @@ describe('useSteering', () => { }); it('degrades to queue without a real conversation id', () => { - const { result } = setup({ conversationId: Constants.NEW_CONVO as string }); + // Seed 'steer' so the assertion exercises the `canSteer ?` degrade + // guard itself, not just the (now default) queue value falling through. + const { result } = setup({ conversationId: Constants.NEW_CONVO as string }, ({ set }) => { + set(store.duringRunDefaultAction, 'steer'); + }); expect(result.current.effectiveAction).toBe('queue'); }); @@ -133,7 +137,11 @@ describe('useSteering', () => { ], } as unknown as TMessage, ]; - const { result } = setup(); + // Seed 'steer' so this proves the pausedOnApproval guard forces queue, + // not just that the default happens to already be queue. + const { result } = setup({}, ({ set }) => { + set(store.duringRunDefaultAction, 'steer'); + }); expect(result.current.pausedOnApproval).toBe(true); expect(result.current.effectiveAction).toBe('queue'); expect(result.current.canSteer).toBe(false); @@ -620,7 +628,11 @@ describe('useSteering', () => { }); it('ignores empty submissions', () => { - const { result } = setup(); + // Seed 'steer' so the mockMutate assertion actually exercises the + // steer path's blank-text guard, not the (now default) queue path. + const { result } = setup({}, ({ set }) => { + set(store.duringRunDefaultAction, 'steer'); + }); let consumed = true; act(() => { consumed = result.current.submitDuringRun(' '); @@ -1899,7 +1911,12 @@ describe('useSteering', () => { }); it('holds during-run submits while uploads are in flight', () => { - const { result } = setupWithFiles({ filesLoading: true }); + // Seed 'steer' so this covers steerFromComposer's own filesLoading + // guard; the queue-path guard is covered separately (queueFromComposer + // is exercised directly with filesLoading in the composer-draft tests). + const { result } = setupWithFiles({ filesLoading: true }, ({ set }) => { + set(store.duringRunDefaultAction, 'steer'); + }); let consumed = true; act(() => { consumed = result.current.steering.submitDuringRun('too early');