refactor(app): refactored tests + added project tests (#11349)

This commit is contained in:
Filip
2026-01-30 21:59:37 +01:00
committed by opencode
parent 4a56491e42
commit 77fa8ddc88
29 changed files with 409 additions and 221 deletions

View File

@@ -1,5 +1,6 @@
import { test, expect } from "../fixtures"
import { dirPath, promptSelector } from "../utils"
import { promptSelector } from "../selectors"
import { dirPath } from "../utils"
test("project route redirects to /session", async ({ page, directory, slug }) => {
await page.goto(dirPath(directory))

View File

@@ -1,14 +1,10 @@
import { test, expect } from "../fixtures"
import { modKey } from "../utils"
import { openPalette } from "../actions"
test("search palette opens and closes", async ({ page, gotoSession }) => {
await gotoSession()
await page.keyboard.press(`${modKey}+P`)
const dialog = page.getByRole("dialog")
await expect(dialog).toBeVisible()
await expect(dialog.getByRole("textbox").first()).toBeVisible()
const dialog = await openPalette(page)
await page.keyboard.press("Escape")
await expect(dialog).toHaveCount(0)

View File

@@ -1,5 +1,5 @@
import { test, expect } from "../fixtures"
import { promptSelector } from "../utils"
import { promptSelector } from "../selectors"
test("can open an existing session and type into the prompt", async ({ page, sdk, gotoSession }) => {
const title = `e2e smoke ${Date.now()}`

View File

@@ -1,5 +1,6 @@
import { test, expect } from "../fixtures"
import { modKey, promptSelector } from "../utils"
import { openSidebar } from "../actions"
import { promptSelector } from "../selectors"
test("titlebar back/forward navigates between sessions", async ({ page, slug, sdk, gotoSession }) => {
await page.setViewportSize({ width: 1400, height: 800 })
@@ -14,12 +15,7 @@ test("titlebar back/forward navigates between sessions", async ({ page, slug, sd
try {
await gotoSession(one.id)
const main = page.locator("main")
const collapsed = ((await main.getAttribute("class")) ?? "").includes("xl:border-l")
if (collapsed) {
await page.keyboard.press(`${modKey}+B`)
await expect(main).not.toHaveClass(/xl:border-l/)
}
await openSidebar(page)
const link = page.locator(`[data-session-id="${two.id}"] a`).first()
await expect(link).toBeVisible()