Repository navigation
Conversation
… floor Tests the router registry wiring, every route file (loaders, heads, skeletons, search validation), the client/server/start entries and the root shell. Floor raised to 88/75/83/85 (lines/branches/functions/statements). routeTree.gen is aliased to a stub under vitest since it is generated at build time. Made-with: agent Co-authored-by: mc-agents[bot] <298817976+mc-agents[bot]@users.noreply.github.com>
CI generates app/routeTree.gen.ts before testing; it is generated code and was counted at 0%. Made-with: agent Co-authored-by: mc-agents[bot] <298817976+mc-agents[bot]@users.noreply.github.com>
|
@greptile-apps please review |
| it('remounts the product page for each product and shows the detail skeleton while loading', async () => { | ||
| const { state, stub } = await h; | ||
| state.loaderData = { product: { id: 5 } }; | ||
| const route = await load('$slug.p$id'); | ||
| expect(route.head).toEqual({ withHeadOf: stub('Product') }); | ||
| const Component = route.component; | ||
| render(<Component />); | ||
| expect(document.querySelector('[data-stub="ProductPage"]')).not.toBeNull(); |
There was a problem hiding this comment.
Product remounting is not tested
This test claims to check remounting, but renders only product 5 and checks that ProductPage exists. Removing key={data.product.id} would still pass.
The repository requires assertions to check the claimed behavior. Before merging, rerender with another product ID and use a stateful stub or mount counter to check that React creates a new instance.
Rule Used: What: Reject assertions that don't actually validate the expected behavior or outcome. Why: Fake assertions give false confidence in test coverage and fail to catch real bugs. Good: ```python def test_user_creation(): user = create_user("John",... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/routes/routeFiles.test.tsx
Line: 382-389
Comment:
**Product remounting is not tested**
This test claims to check remounting, but renders only product 5 and checks that `ProductPage` exists. Removing `key={data.product.id}` would still pass.
The repository requires assertions to check the claimed behavior. Before merging, rerender with another product ID and use a stateful stub or mount counter to check that React creates a new instance.
**Rule Used:** What: Reject assertions that don't actually validate the expected behavior or outcome. Why: Fake assertions give false confidence in test coverage and fail to catch real bugs. Good: ```python def test_user_creation(): user = create_user("John",... ([source](https://app.greptile.com/salla/-/custom-context?memory=4475f6ab-b5f0-46e4-98d5-1f1eb133c1df))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| expect(e.removeEdgeInjections).toHaveBeenCalledTimes(1); | ||
| await vi.waitFor(() => expect(e.hydrateRoot).toHaveBeenCalledTimes(1)); | ||
| expect(e.hydrateRoot.mock.calls[0][0]).toBe(document); |
There was a problem hiding this comment.
This test checks that both functions run, but not that removeEdgeInjections runs before hydrateRoot. Reversing those calls would still pass despite the test's “then hydrates” claim.
The repository requires assertions to check the claimed behavior. Before merging, compare their recorded call order to protect cleanup before hydration.
Rule Used: What: Reject assertions that don't actually validate the expected behavior or outcome. Why: Fake assertions give false confidence in test coverage and fail to catch real bugs. Good: ```python def test_user_creation(): user = create_user("John",... (source)
Knowledge Base Used: Runtime entrypoints
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/routes/entry.test.tsx
Line: 59-61
Comment:
**Cleanup order is not tested**
This test checks that both functions run, but not that `removeEdgeInjections` runs before `hydrateRoot`. Reversing those calls would still pass despite the test's “then hydrates” claim.
The repository requires assertions to check the claimed behavior. Before merging, compare their recorded call order to protect cleanup before hydration.
**Rule Used:** What: Reject assertions that don't actually validate the expected behavior or outcome. Why: Fake assertions give false confidence in test coverage and fail to catch real bugs. Good: ```python def test_user_creation(): user = create_user("John",... ([source](https://app.greptile.com/salla/-/custom-context?memory=4475f6ab-b5f0-46e4-98d5-1f1eb133c1df))
**Knowledge Base Used:** [Runtime entrypoints](https://app.greptile.com/salla/-/custom-context/knowledge-base/sallaapp/theme-raed-react/-/docs/runtime-entrypoints.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| DefaultHomeComponents: { engineOnly: 'engine', brands: 'engine-brands' }, | ||
| })); | ||
| vi.mock('@salla.sa/twilight-components-react', () => ({ | ||
| SliderSkeleton: () => <div data-testid="slider-skeleton" />, |
There was a problem hiding this comment.
Selectors break the naming rule
The new data-testid values slider-skeleton and list-page do not follow the required <feature>-<component>-<action> format. Before merging, rename both values and their matching queries to include all three parts.
Rule Used: # Code Review Rule: data-testid Naming Convention What: All data-testid attributes must follow the kebab-case format <feature>-<component>-<action>, with dynamic elements including their item ID. Why: Consistent selector naming enables ... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/routes/router.test.tsx
Line: 21
Comment:
**Selectors break the naming rule**
The new `data-testid` values `slider-skeleton` and `list-page` do not follow the required `<feature>-<component>-<action>` format. Before merging, rename both values and their matching queries to include all three parts.
**Rule Used:** # Code Review Rule: data-testid Naming Convention **What:** All `data-testid` attributes must follow the kebab-case format `<feature>-<component>-<action>`, with dynamic elements including their item ID. **Why:** Consistent selector naming enables ... ([source](https://app.greptile.com/salla/-/custom-context?memory=43bb0927-6c63-4b85-9b79-52904ec74d75))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
@greptileai review |
| const html = renderToString(<Shell />); | ||
|
|
||
| expect(rendered.stylesheet?.critical).toEqual({ | ||
| [HOME_ROUTE_ID]: '', | ||
| [PRODUCT_ROUTE_ID]: '', | ||
| }); | ||
| expect(html).not.toContain('dev-settings-widget'); |
There was a problem hiding this comment.
Production editor check misses regressions
This test can pass even if the settings editor loses its DEV guard. After vi.resetModules(), the editor would be a fresh lazy component. renderToString() renders its empty Suspense fallback without waiting, so the missing text does not prove the editor is disabled.
The repository requires assertions to check the claimed behavior. Before merging, wait for rendering to finish, as the development test does, then check that the editor is absent.
Rule Used: What: Reject assertions that don't actually validate the expected behavior or outcome. Why: Fake assertions give false confidence in test coverage and fail to catch real bugs. Good: ```python def test_user_creation(): user = create_user("John",... (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: tests/routes/root.test.tsx
Line: 85-91
Comment:
**Production editor check misses regressions**
This test can pass even if the settings editor loses its `DEV` guard. After `vi.resetModules()`, the editor would be a fresh lazy component. `renderToString()` renders its empty `Suspense` fallback without waiting, so the missing text does not prove the editor is disabled.
The repository requires assertions to check the claimed behavior. Before merging, wait for rendering to finish, as the development test does, then check that the editor is absent.
**Rule Used:** What: Reject assertions that don't actually validate the expected behavior or outcome. Why: Fake assertions give false confidence in test coverage and fail to catch real bugs. Good: ```python def test_user_creation(): user = create_user("John",... ([source](https://app.greptile.com/salla/-/custom-context?memory=4475f6ab-b5f0-46e4-98d5-1f1eb133c1df))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
… is absent in production Made-with: agent Co-authored-by: mc-agents[bot] <298817976+mc-agents[bot]@users.noreply.github.com>
|
Automatic reviews are disabled for this repository. |
82943f5
into
feature/quality-gates-twig-parity-audit
Summary
First coverage PR for SAL-3525 (router and route wiring).
app/router.tsx: registry registrations, home block overrides, per-block placement config (class names for boxed/merged/repeated variants),getRoutersingleton on the client vs fresh per request on the server.app/routes/: engine loader args, head, loading skeleton, rendered component, search validation for orders/wallet/wishlist, product referrer cleanup, page-single mapping, redirects.client,hydrate,start,server,routes.tsand the dev/production branches of__root.tsx.vitest.config.ts: floor raised to lines 88, branches 75, functions 83, statements 85 (measured 88.35 / 75.73 / 83.01 / 85.68, rounded down).app/router.tsxis now measured by v8 too.routeTree.genis aliased to a stub in vitest (tests/stubs/routeTree.gen.ts) because the generated file is absent on a clean checkout.No application code changed. No coverage exclusions added.
Verification
build, typecheck, lint, format:check, test:coverage, check:manifest and knip exit 0 locally (Node 22).
Exclusions
app/routeTree.gen.ts: generated by the router plugin at build time (CI generates it before testing).The test assertions and selector names must meet the repository’s requirements before merging.
Findings
Fix with agent prompt
Summary
Adds tests for router setup, route files, browser startup, server startup, and root rendering.
Reviews (2) · Last reviewed commit: "test(SAL-3525): exclude the generated ro..." · Reviewed by Greptile