Skip to content

Commit ba9c46d

Browse files
committed
test(ThikningBudget): coverage
1 parent 41ba0c3 commit ba9c46d

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

‎webview-ui/src/components/settings/__tests__/ThinkingBudget.spec.tsx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,23 @@ describe("ThinkingBudget", () => {
289289
expect(screen.getByTestId("select")).toHaveAttribute("data-value", "low")
290290
})
291291

292+
it("should fall back to rawReasoningEffort when availableOptions is empty", () => {
293+
// Covers the ?? rawReasoningEffort branch when availableOptions[0] is undefined
294+
render(
295+
<ThinkingBudget
296+
{...defaultProps}
297+
apiConfiguration={{ reasoningEffort: "medium" }}
298+
modelInfo={{
299+
...reasoningEffortModelInfo,
300+
supportsReasoningEffort: [] as any,
301+
}}
302+
/>,
303+
)
304+
305+
// With an empty options array, falls back to the stored value "medium"
306+
expect(screen.getByTestId("select")).toHaveAttribute("data-value", "medium")
307+
})
308+
292309
it("should show 'disable' option when supportsReasoningEffort array explicitly includes disable", () => {
293310
render(
294311
<ThinkingBudget

0 commit comments

Comments
 (0)