fix(webui): route first-run model setup choices
This commit is contained in:
@@ -887,6 +887,7 @@ describe("ThreadShell", () => {
|
||||
fireEvent.click(screen.getByRole("button", { name: "Close" }));
|
||||
|
||||
const input = screen.getByRole("textbox", { name: "Message input" });
|
||||
await waitFor(() => expect(input).toHaveFocus());
|
||||
fireEvent.change(input, {
|
||||
target: { value: "hello" },
|
||||
});
|
||||
@@ -896,12 +897,37 @@ describe("ThreadShell", () => {
|
||||
expect(input).toHaveValue("hello");
|
||||
fireEvent.click(screen.getByRole("button", { name: "Use an API key" }));
|
||||
|
||||
expect(onOpenModelSettings).toHaveBeenCalledTimes(1);
|
||||
expect(onOpenModelSettings).toHaveBeenCalledWith("apiKey");
|
||||
expect(input).toHaveValue("hello");
|
||||
await waitFor(() => expect(input).toHaveFocus());
|
||||
expect(input).not.toHaveFocus();
|
||||
expect(client.sendMessage).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("focuses the composer when returning from model setup", async () => {
|
||||
const client = makeClient();
|
||||
const settings = modelSettings("openai-codex/gpt-5.1-codex", "openai_codex");
|
||||
settings.agent.has_api_key = false;
|
||||
const view = (focusComposerRequest: number) => wrap(
|
||||
client,
|
||||
<ThreadShell
|
||||
session={session("setup-focus")}
|
||||
title="Setup focus"
|
||||
onToggleSidebar={() => {}}
|
||||
settingsSnapshot={settings}
|
||||
focusComposerRequest={focusComposerRequest}
|
||||
/>,
|
||||
"openai-codex/gpt-5.1-codex",
|
||||
);
|
||||
const { rerender } = render(view(0));
|
||||
const input = await screen.findByRole("textbox", { name: "Message input" });
|
||||
input.blur();
|
||||
expect(input).not.toHaveFocus();
|
||||
|
||||
rerender(view(1));
|
||||
|
||||
await waitFor(() => expect(input).toHaveFocus());
|
||||
});
|
||||
|
||||
it("keeps image generation controls out of the composer", async () => {
|
||||
const client = makeClient();
|
||||
const disabledSettings = modelSettings("deepseek-v4-pro", "deepseek");
|
||||
|
||||
Reference in New Issue
Block a user