diff options
| author | Filip <[email protected]> | 2026-01-30 02:05:31 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-01-29 19:05:31 -0600 |
| commit | b43a35b737087e3464308b02232b1459f0f8df60 (patch) | |
| tree | 74e3d7e605feacc4f2a6dee550905abe37e92d9d | |
| parent | 03803621dbb20d15553635eb810d466dc1255fdc (diff) | |
| download | opencode-b43a35b737087e3464308b02232b1459f0f8df60.tar.gz opencode-b43a35b737087e3464308b02232b1459f0f8df60.zip | |
test(app): test for toggling model variant (#11221)
| -rw-r--r-- | packages/app/e2e/thinking-level.spec.ts | 25 | ||||
| -rw-r--r-- | packages/app/e2e/utils.ts | 1 | ||||
| -rw-r--r-- | packages/app/src/components/prompt-input.tsx | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/packages/app/e2e/thinking-level.spec.ts b/packages/app/e2e/thinking-level.spec.ts new file mode 100644 index 000000000..564ef3c1f --- /dev/null +++ b/packages/app/e2e/thinking-level.spec.ts @@ -0,0 +1,25 @@ +import { test, expect } from "./fixtures" +import { modelVariantCycleSelector } from "./utils" + +test("smoke model variant cycle updates label", async ({ page, gotoSession }) => { + await gotoSession() + + await page.addStyleTag({ + content: `${modelVariantCycleSelector} { display: inline-block !important; }`, + }) + + const button = page.locator(modelVariantCycleSelector) + const exists = (await button.count()) > 0 + test.skip(!exists, "current model has no variants") + if (!exists) return + + await expect(button).toBeVisible() + + const before = (await button.innerText()).trim() + await button.click() + await expect(button).not.toHaveText(before) + + const after = (await button.innerText()).trim() + await button.click() + await expect(button).not.toHaveText(after) +}) diff --git a/packages/app/e2e/utils.ts b/packages/app/e2e/utils.ts index eb0395950..3de488bd9 100644 --- a/packages/app/e2e/utils.ts +++ b/packages/app/e2e/utils.ts @@ -12,6 +12,7 @@ export const terminalToggleKey = "Control+Backquote" export const promptSelector = '[data-component="prompt-input"]' export const terminalSelector = '[data-component="terminal"]' +export const modelVariantCycleSelector = '[data-action="model-variant-cycle"]' export function createSdk(directory?: string) { return createOpencodeClient({ baseUrl: serverUrl, directory, throwOnError: true }) diff --git a/packages/app/src/components/prompt-input.tsx b/packages/app/src/components/prompt-input.tsx index 4d227f44b..5c1d417eb 100644 --- a/packages/app/src/components/prompt-input.tsx +++ b/packages/app/src/components/prompt-input.tsx @@ -1953,6 +1953,7 @@ export const PromptInput: Component<PromptInputProps> = (props) => { keybind={command.keybind("model.variant.cycle")} > <Button + data-action="model-variant-cycle" variant="ghost" class="text-text-base _hidden group-hover/prompt-input:inline-block capitalize text-12-regular" onClick={() => local.model.variant.cycle()} |
