Skip to content

Commit 091670f

Browse files
loganjLarryBrother Darryl
committed
fix(e2e): close bootstrap checker receiver gaps
Preserve unsafe bootstrap events through supported parenthesized forms and grant loop bootstrap credit only when syntax proves an enumerable runtime iteration. Co-authored-by: Larry <[email protected]> Co-authored-by: Brother Darryl <[email protected]> Signed-off-by: Logan Johnson <[email protected]>
1 parent cd0d33f commit 091670f

178 files changed

Lines changed: 6391 additions & 1334 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎AGENTS.md‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,18 @@ you; prefer them over a manual build plus `playwright test`.
398398
serves old code. Kill port 4173 and re-run `pnpm build:e2e` before re-running
399399
tests after code changes.
400400

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

405414
**Live messages:** Call `waitForMockLiveSubscription(page, channelName)` before
406415
`__BUZZ_E2E_EMIT_MOCK_MESSAGE__` — messages are silently dropped without a

‎desktop/biome.json‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
11
{
2-
"extends": ["../biome.json"]
2+
"extends": ["../biome.json"],
3+
"overrides": [
4+
{
5+
"includes": ["tests/e2e/**"],
6+
"linter": {
7+
"rules": {
8+
"style": {
9+
"noRestrictedImports": {
10+
"level": "error",
11+
"options": {
12+
"paths": {
13+
"@playwright/test": {
14+
"importNames": ["test", "base", "default", "*"],
15+
"message": "Import test from ../helpers/test so every E2E test receives automatic origin bootstrap."
16+
}
17+
}
18+
}
19+
}
20+
}
21+
}
22+
}
23+
}
24+
]
325
}

‎desktop/package.json‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"check:px-text": "node ./scripts/check-px-text.mjs",
1313
"check:pubkey-truncation": "node ./scripts/check-pubkey-truncation.mjs",
1414
"lint": "biome lint .",
15-
"check": "biome check . && pnpm check:px-text && pnpm check:pubkey-truncation",
15+
"check": "biome check . && pnpm check:px-text && pnpm check:e2e-bootstrap && pnpm check:pubkey-truncation",
1616
"format": "biome format --write .",
1717
"test": "node --import ./test-loader.mjs --experimental-strip-types --test \"src/**/*.test.mjs\"",
1818
"preview": "vite preview",
@@ -22,7 +22,9 @@
2222
"test:e2e:integration": "pnpm build:e2e && playwright test --project=integration",
2323
"test:e2e:release-smoke": "pnpm build:e2e && playwright test --config=playwright.release-smoke.config.ts",
2424
"test:e2e:report": "playwright show-report",
25-
"tauri:build": "tauri build"
25+
"tauri:build": "tauri build",
26+
"check:e2e-bootstrap": "pnpm test:check-e2e-bootstrap && node ./scripts/check-e2e-bootstrap.mjs",
27+
"test:check-e2e-bootstrap": "node --test ./scripts/check-e2e-bootstrap.test.mjs"
2628
},
2729
"dependencies": {
2830
"@dnd-kit/core": "^6.3.1",

‎desktop/playwright.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default defineConfig({
2020
name: "smoke",
2121
testMatch: [
2222
"**/smoke.spec.ts",
23+
"**/bootstrap.spec.ts",
2324
"**/sidebar-offcanvas-rail.spec.ts",
2425
"**/search-scope-screenshots.spec.ts",
2526
"**/onboarding-docked-cta-screenshots.spec.ts",

0 commit comments

Comments
 (0)