chore: cleanup

This commit is contained in:
Adam
2026-01-19 08:38:42 -06:00
parent 5c43d3f3b7
commit 39054409f4
3 changed files with 32 additions and 15 deletions

View File

@@ -9,12 +9,29 @@ test("context panel can be opened from the prompt", async ({ page, sdk, gotoSess
const sessionID = created.id
try {
await sdk.session.promptAsync({
sessionID,
noReply: true,
parts: [
{
type: "text",
text: "seed context",
},
],
})
await expect
.poll(async () => {
const messages = await sdk.session.messages({ sessionID, limit: 1 }).then((r) => r.data ?? [])
return messages.length
})
.toBeGreaterThan(0)
await gotoSession(sessionID)
const promptForm = page.locator("form").filter({ has: page.locator(promptSelector) }).first()
const contextButton = promptForm
.locator("button")
.filter({ has: promptForm.locator('[data-component="progress-circle"]').first() })
const contextButton = page
.locator('[data-component="button"]')
.filter({ has: page.locator('[data-component="progress-circle"]').first() })
.first()
await expect(contextButton).toBeVisible()

View File

@@ -12,13 +12,12 @@ test("can open a file tab from the search palette", async ({ page, gotoSession }
const input = dialog.getByRole("textbox").first()
await input.fill("package.json")
const firstItem = dialog.locator('[data-slot="list-item"]').first()
await expect(firstItem).toBeVisible()
await firstItem.click()
const fileItem = dialog.locator('[data-slot="list-item"][data-key^="file:"]').first()
await expect(fileItem).toBeVisible()
await fileItem.click()
await expect(dialog).toHaveCount(0)
const tabs = page.locator('[data-component="tabs"][data-variant="normal"]')
await expect(tabs).toBeVisible()
await expect(tabs.getByRole("tab").first()).toBeVisible()
await expect(tabs.locator('[data-slot="tabs-trigger"]').first()).toBeVisible()
})

View File

@@ -4,17 +4,18 @@ import { modKey } from "./utils"
test("sidebar can be collapsed and expanded", async ({ page, gotoSession }) => {
await gotoSession()
const createButton = page.getByRole("button", { name: /New (session|workspace)/ }).first()
const opened = (await createButton.count()) > 0
const main = page.locator("main")
const closedClass = /xl:border-l/
const isClosed = await main.evaluate((node) => node.className.includes("xl:border-l"))
if (!opened) {
if (isClosed) {
await page.keyboard.press(`${modKey}+B`)
await expect(createButton).toBeVisible()
await expect(main).not.toHaveClass(closedClass)
}
await page.keyboard.press(`${modKey}+B`)
await expect(createButton).toHaveCount(0)
await expect(main).toHaveClass(closedClass)
await page.keyboard.press(`${modKey}+B`)
await expect(createButton).toBeVisible()
await expect(main).not.toHaveClass(closedClass)
})