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,21 +1,14 @@
import { test, expect } from "../fixtures"
import { modKey } from "../utils"
import { openSidebar, toggleSidebar } from "../actions"
test("sidebar can be collapsed and expanded", async ({ page, gotoSession }) => {
await gotoSession()
const main = page.locator("main")
const closedClass = /xl:border-l/
const isClosed = await main.evaluate((node) => node.className.includes("xl:border-l"))
await openSidebar(page)
if (isClosed) {
await page.keyboard.press(`${modKey}+B`)
await expect(main).not.toHaveClass(closedClass)
}
await toggleSidebar(page)
await expect(page.locator("main")).toHaveClass(/xl:border-l/)
await page.keyboard.press(`${modKey}+B`)
await expect(main).toHaveClass(closedClass)
await page.keyboard.press(`${modKey}+B`)
await expect(main).not.toHaveClass(closedClass)
await toggleSidebar(page)
await expect(page.locator("main")).not.toHaveClass(/xl:border-l/)
})