Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -398,9 +398,18 @@ you; prefer them over a manual build plus `playwright test`.
serves old code. Kill port 4173 and re-run `pnpm build:e2e` before re-running
tests after code changes.

**`addInitScript` before bridge:** `page.addInitScript` (localStorage seeding)
must run BEFORE `installMockBridge(page)` — React reads state on mount, the
bridge triggers mount.
**Explicit E2E bootstrap:** Browser specs import `test`, `expect`, and
`bootstrapE2ePage` from the suite's `tests/helpers/test`, not `@playwright/test`.
After all pre-navigation setup (including `addInitScript`, routes, and
`installMockBridge(page)`), every test using the Playwright `page` fixture must
`await bootstrapE2ePage(page, ...)` before accessing browser storage or the app.
This commits the first navigation to the configured HTTP origin and reports a
missing build or preview server before later storage access can misreport it as
a `localStorage` failure. Non-browser CLI/relay harnesses without a `page`
fixture do not bootstrap. Keep storage init scripts origin-guarded; do not
suppress storage errors.

Rejects loop coverage when the condition is the boolean literal false, or when for...of / for...in uses a statically empty literal iterable/object; transparent parentheses around those literals are equivalent. Other runtime or constant-expression iteration counts are outside this syntactic check.

**Live messages:** Call `waitForMockLiveSubscription(page, channelName)` before
`__BUZZ_E2E_EMIT_MOCK_MESSAGE__` — messages are silently dropped without a
Expand Down
24 changes: 23 additions & 1 deletion desktop/biome.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
{
"extends": ["../biome.json"]
"extends": ["../biome.json"],
"overrides": [
{
"includes": ["tests/e2e/**"],
"linter": {
"rules": {
"style": {
"noRestrictedImports": {
"level": "error",
"options": {
"paths": {
"@playwright/test": {
"importNames": ["test", "base", "default", "*"],
"message": "Import test from ../helpers/test so every E2E test receives automatic origin bootstrap."
}
}
}
}
}
}
}
}
]
}
6 changes: 4 additions & 2 deletions desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"check:px-text": "node ./scripts/check-px-text.mjs",
"check:pubkey-truncation": "node ./scripts/check-pubkey-truncation.mjs",
"lint": "biome lint .",
"check": "biome check . && pnpm check:px-text && pnpm check:pubkey-truncation",
"check": "biome check . && pnpm check:px-text && pnpm check:e2e-bootstrap && pnpm check:pubkey-truncation",
"format": "biome format --write .",
"test": "node --import ./test-loader.mjs --experimental-strip-types --test \"src/**/*.test.mjs\"",
"preview": "vite preview",
Expand All @@ -22,7 +22,9 @@
"test:e2e:integration": "pnpm build:e2e && playwright test --project=integration",
"test:e2e:release-smoke": "pnpm build:e2e && playwright test --config=playwright.release-smoke.config.ts",
"test:e2e:report": "playwright show-report",
"tauri:build": "tauri build"
"tauri:build": "tauri build",
"check:e2e-bootstrap": "pnpm test:check-e2e-bootstrap && node ./scripts/check-e2e-bootstrap.mjs",
"test:check-e2e-bootstrap": "node --test ./scripts/check-e2e-bootstrap.test.mjs"
},
"dependencies": {
"@dnd-kit/core": "^6.3.1",
Expand Down
1 change: 1 addition & 0 deletions desktop/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export default defineConfig({
name: "smoke",
testMatch: [
"**/smoke.spec.ts",
"**/bootstrap.spec.ts",
"**/sidebar-offcanvas-rail.spec.ts",
"**/search-scope-screenshots.spec.ts",
"**/onboarding-docked-cta-screenshots.spec.ts",
Expand Down
Loading