feat(quick-pane): add compact runtime controls
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { fireEvent, render, screen, within } from "@testing-library/react";
|
||||
import { expect, it, vi } from "vitest";
|
||||
import { ThinkingSelector } from "./ThinkingSelector";
|
||||
|
||||
it("uses selected model thinking capabilities and reconciles unavailable values", () => {
|
||||
const onChange = vi.fn();
|
||||
render(
|
||||
<ThinkingSelector
|
||||
model={{ thinkingLevelMap: { off: "off", high: "high" } }}
|
||||
value="medium"
|
||||
onChange={onChange}
|
||||
/>,
|
||||
);
|
||||
|
||||
const selector = screen.getByRole("combobox", { name: "Thinking" });
|
||||
expect(selector).toHaveValue("off");
|
||||
expect(
|
||||
within(selector).getAllByRole("option").map((option) => option.textContent),
|
||||
).toEqual(["Off", "High"]);
|
||||
fireEvent.change(selector, { target: { value: "high" } });
|
||||
expect(onChange).toHaveBeenCalledWith("high");
|
||||
});
|
||||
|
||||
it("uses disabled native select semantics", () => {
|
||||
render(<ThinkingSelector value="off" disabled onChange={vi.fn()} />);
|
||||
expect(screen.getByRole("combobox", { name: "Thinking" })).toBeDisabled();
|
||||
});
|
||||
Reference in New Issue
Block a user