File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { test , expect } from "./fixtures"
2+ import { modelVariantCycleSelector } from "./utils"
3+
4+ test ( "smoke model variant cycle updates label" , async ( { page, gotoSession } ) => {
5+ await gotoSession ( )
6+
7+ await page . addStyleTag ( {
8+ content : `${ modelVariantCycleSelector } { display: inline-block !important; }` ,
9+ } )
10+
11+ const button = page . locator ( modelVariantCycleSelector )
12+ const exists = ( await button . count ( ) ) > 0
13+ test . skip ( ! exists , "current model has no variants" )
14+ if ( ! exists ) return
15+
16+ await expect ( button ) . toBeVisible ( )
17+
18+ const before = ( await button . innerText ( ) ) . trim ( )
19+ await button . click ( )
20+ await expect ( button ) . not . toHaveText ( before )
21+
22+ const after = ( await button . innerText ( ) ) . trim ( )
23+ await button . click ( )
24+ await expect ( button ) . not . toHaveText ( after )
25+ } )
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const terminalToggleKey = "Control+Backquote"
1212
1313export const promptSelector = '[data-component="prompt-input"]'
1414export const terminalSelector = '[data-component="terminal"]'
15+ export const modelVariantCycleSelector = '[data-action="model-variant-cycle"]'
1516
1617export function createSdk ( directory ?: string ) {
1718 return createOpencodeClient ( { baseUrl : serverUrl , directory, throwOnError : true } )
Original file line number Diff line number Diff line change @@ -1953,6 +1953,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => {
19531953 keybind = { command . keybind ( "model.variant.cycle" ) }
19541954 >
19551955 < Button
1956+ data-action = "model-variant-cycle"
19561957 variant = "ghost"
19571958 class = "text-text-base _hidden group-hover/prompt-input:inline-block capitalize text-12-regular"
19581959 onClick = { ( ) => local . model . variant . cycle ( ) }
You can’t perform that action at this time.
0 commit comments