cloudaxe-opencode/packages/app/e2e/sidebar.spec.ts

22 lines
648 B
TypeScript
Raw Permalink Normal View History

2026-01-19 12:54:47 +00:00
import { test, expect } from "./fixtures"
import { modKey } from "./utils"
test("sidebar can be collapsed and expanded", async ({ page, gotoSession }) => {
await gotoSession()
2026-01-19 14:38:42 +00:00
const main = page.locator("main")
const closedClass = /xl:border-l/
const isClosed = await main.evaluate((node) => node.className.includes("xl:border-l"))
2026-01-19 12:54:47 +00:00
2026-01-19 14:38:42 +00:00
if (isClosed) {
2026-01-19 12:54:47 +00:00
await page.keyboard.press(`${modKey}+B`)
2026-01-19 14:38:42 +00:00
await expect(main).not.toHaveClass(closedClass)
2026-01-19 12:54:47 +00:00
}
await page.keyboard.press(`${modKey}+B`)
2026-01-19 14:38:42 +00:00
await expect(main).toHaveClass(closedClass)
2026-01-19 12:54:47 +00:00
await page.keyboard.press(`${modKey}+B`)
2026-01-19 14:38:42 +00:00
await expect(main).not.toHaveClass(closedClass)
2026-01-19 12:54:47 +00:00
})