GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(app): test for toggling model variant (#11221) · MarsQiu007/openNovel@5befba3

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/app
    • e2e
      • thinking-level.spec.ts
      • utils.ts
    • src/components
      • prompt-input.tsx
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/app/e2e/thinking-level.spec.ts‎

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
})
Collapse file

‎packages/app/e2e/utils.ts‎

Copy file name to clipboardExpand all lines: packages/app/e2e/utils.ts
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export const terminalToggleKey = "Control+Backquote"
1212

1313
export const promptSelector = '[data-component="prompt-input"]'
1414
export const terminalSelector = '[data-component="terminal"]'
15+
export const modelVariantCycleSelector = '[data-action="model-variant-cycle"]'
1516

1617
export function createSdk(directory?: string) {
1718
return createOpencodeClient({ baseUrl: serverUrl, directory, throwOnError: true })
Collapse file

‎packages/app/src/components/prompt-input.tsx‎

Copy file name to clipboardExpand all lines: packages/app/src/components/prompt-input.tsx
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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()}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.