Skip to content

Commit db66b19

Browse files
only21milclaude
andcommitted
test(web): assert the composer's effective model and options after the Cursor switch-back
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 5273207 commit db66b19

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

‎apps/web/src/components/chat/useComposerSelection.browser.test.tsx‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { expect, it, vi } from "vite-plus/test";
1313
import { page } from "vite-plus/test/browser";
1414

1515
import { render } from "../../../test/render";
16-
import { useComposerDraftStore } from "../../composerDraftStore";
16+
import { deriveEffectiveComposerModelState, useComposerDraftStore } from "../../composerDraftStore";
1717
import { useComposerSelection } from "./useComposerSelection";
1818

1919
const environmentId = EnvironmentId.make("environment-local");
@@ -99,5 +99,16 @@ it("switches back to the thread's stored model while the session runs on another
9999
.getState()
100100
.getComposerDraft(scopeThreadRef(environmentId, thread.id));
101101
expect(draft?.activeProvider).toBe(cursor);
102+
expect(
103+
deriveEffectiveComposerModelState({
104+
draft,
105+
providers,
106+
selectedProvider: ProviderDriverKind.make("cursor"),
107+
selectedInstanceId: cursor,
108+
threadModelSelection: thread.modelSelection,
109+
projectModelSelection: null,
110+
settings: DEFAULT_UNIFIED_SETTINGS,
111+
}),
112+
).toEqual({ selectedModel: stored.model, modelOptions: { [cursor]: stored.options } });
102113
});
103114
});

0 commit comments

Comments
 (0)