Address code review feedback from PR #28#29
Address code review feedback from PR #28#29Steake merged 3 commits intoclaude/identify-next-steps-011CUkvaedPA7QhrXGbbj54gfrom
Conversation
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
Co-authored-by: Steake <530040+Steake@users.noreply.github.com>
507146d
into
claude/identify-next-steps-011CUkvaedPA7QhrXGbbj54g
There was a problem hiding this comment.
Pull request overview
This PR addresses follow-up review feedback from PR #28 by tightening mock data generation, improving Playwright E2E reliability, and cleaning up related configuration/documentation in the SvelteKit dApp and its mock backend.
Changes:
- Switch mock proof hash generation to
crypto.randomBytes(32)and remove unused request-body fields in the mock server. - Improve Playwright smoke test reliability by capturing
pageerrorbefore navigation and replacing fixed delays with selector-based waits. - Refactor Playwright
webServer.commandselection for CI vs local runs and reduce startup timeout.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/mock-api-consistency.test.ts | Normalizes formatting/quoting for the mock API consistency unit test. |
| tests/e2e/smoke.test.ts | Captures page errors earlier and replaces arbitrary sleeps with an h1-based readiness check. |
| src/routes/+layout.svelte | Removes an extra blank line (formatting cleanup). |
| src/lib/web3/onboard.ts | Formats the @web3-onboard/core import and makes the primary chain selection logic clearer. |
| src/hooks.client.js | Normalizes quoting and adds a trailing comma in the returned error object. |
| server/index.ts | Uses crypto.randomBytes for stable-length mock hashes and removes unused destructured fields. |
| playwright.config.ts | Extracts web server command selection and changes web server timeout to 120s. |
| documentation/vision-delivery-blueprint.md | Markdown spacing/formatting adjustments. |
| SVELTE_E2E_FIX_REPORT.md | Markdown spacing/formatting adjustments. |
| NEXT_STEPS_IMPLEMENTATION_PLAN.md | Markdown spacing/formatting adjustments. |
| IMPLEMENTATION_FIXES_REPORT.md | Markdown spacing/formatting adjustments (tables/headings). |
| E2E_ROOT_CAUSE_ANALYSIS.md | Markdown spacing/formatting adjustments (tables/sections). |
| CIRCUIT_GENERATION_GUIDE.md | Markdown spacing/formatting adjustments (tables/sections). |
| BACKEND_E2E_FIXES_REPORT.md | Markdown spacing/formatting adjustments (tables/sections). |
Comments suppressed due to low confidence (1)
tests/e2e/smoke.test.ts:38
- This test collects
pageerrors but only logs a warning when errors are detected; it never fails the test. That allows runtime exceptions during page load to slip through CI as passing tests. Consider asserting thaterrorsis empty (or filtering/allowlisting known non-critical errors and failing on the rest) once the page is considered initialized.
// Wait for main heading to appear, indicating JS initialization
await page.waitForSelector("h1", { timeout: 5000 });
if (errors.length > 0) {
console.warn("⚠ Console errors detected:", errors);
} else {
console.log("✓ No critical page errors detected");
| webServer: { | ||
| command: "npm run build && npm run preview", | ||
| command: getWebServerCommand(), | ||
| url: "http://localhost:4173", | ||
| reuseExistingServer: !process.env.CI, | ||
| timeout: 180000, // 3 minutes for build + preview | ||
| timeout: 120000, // 2 minutes for preview server startup | ||
| }, |
There was a problem hiding this comment.
webServer.timeout was reduced to 120s, but in non-CI runs command still includes npm run build && npm run preview, so the timeout still needs to cover the build time as well. This can cause local/PR runs (where CI is unset) to flake if builds take >2 minutes. Consider making the timeout conditional (longer when the build is part of the command) or splitting build/preview so the timeout meaning stays consistent with the comment.
Addresses all review comments from PR #28 covering mock data generation, test reliability, and build optimization.
Mock hash generation
crypto.randomBytes(32)instead ofMath.random()to avoid potential leading zeros in hex stringspriority,userId,circuitType)E2E test reliability
page.on("pageerror")beforepage.goto()to capture errors during page loadwaitForTimeout()delays with condition-basedwaitForSelector("h1")Playwright build optimization
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.