Repository navigation
test(e2e): isolate JSON import fixture timestamps - #1290
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@greptileai review this at apex |
[Low impact] The effects stay within one E2E test and its shared test data. The PR appears safe to merge, with a non-blocking improvement to make failed cleanup visible. Findings
|
2473e45 to
b76140b
Compare
Fixes #1289
Intent
Fix GitHub Issue #1289 (
test(e2e): use canonical UTC timestamps and isolate shared JSON import fixture, follow-up to PR #1280).In
frontend/e2e/database-export-import.spec.ts(imports JSON payload containing FTS shadow tables and virtual generated columns and rebuilds search), replace the non-canonicalnew Date().toISOString()(YYYY-MM-DDTHH:MM:SS.sssZ) fixture timestamps and clean up the imported fixture rows infinallyso the test never pollutes/api/orderspagination ordering infrontend/e2e/orders-master-detail.spec.ts.What Changed
new Date().toISOString()timestamps on the importedproducts,inventory_movements,customers, andordersfixture rows infrontend/e2e/database-export-import.spec.tswith a fixed canonical UTC timestamp (2020-01-01 00:00:00).PATCH /api/orders/:id/statuscall in the test'sfinallyblock to cancel the imported fixture order (uniqueOrderId) alongside deleting the test product.Risk Assessment
✅ Low: Test-only E2E fixture update in frontend/e2e/database-export-import.spec.ts that replaces ISO-8601 timestamps with a canonical SQLite UTC timestamp and cancels the imported fixture order during teardown so it cannot pollute /api/orders pagination in subsequent specs.
Testing
Built the backend and static frontend, ran
e2e/database-export-import.spec.tsande2e/orders-master-detail.spec.tssequentially on a shared live E2E server instance (all 27 tests passing), and captured browser screenshots and API pagination evidence confirming that the canonical2020-01-01 00:00:00fixture timestamp andfinallycleanup prevent imported fixture rows from polluting/api/orderspagination ordering.Evidence: Post-import FTS search, cleanup, and /api/orders pagination isolation verification summary
{ "ftsSearchBeforeCleanup": { "byOrderNumberFound": true, "byCustomerNameFound": true }, "importedOrderAfterCleanup": { "id": 854321, "order_number": "ORD-E2E-evid01", "status": "cancelled", "created_at": "2020-01-01 00:00:00" }, "activeViewPage1": { "count": 15, "nextCursor": null, "containsImportedFixtureOrder": false, "containsOldestOf15NewOrders": true, "firstOrderNumber": "ORD-20261022-0015", "lastOrderNumber": "ORD-20261022-0001" }, "allViewPage1": { "count": 15, "nextCursor": 854322, "containsImportedFixtureOrderOnPage1": false, "containsAll15NewOrdersOnPage1": true } }Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
npm cinpm run build && npm run build:frontendcd frontend && CI=1 E2E_BASE_URL=http://127.0.0.1:43001 E2E_KDS_BASE_URL=http://127.0.0.1:43002 E2E_SERVER_APP_BASE_URL=http://127.0.0.1:43003 FLO_VERIFICATION_SCREENSHOT_PATH=~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/database-export-import.png npx playwright test --config=playwright.config.ts --project=chromium --retries=0 e2e/database-export-import.spec.ts e2e/orders-master-detail.spec.tsLive Playwright + API verification of contaminated JSON import, FTS order/customer search, finally order cancellation/product deletion, and 15-order pagination boundary on/orders(view=activeandview=all) againstnode tests/e2e-server.cjs✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.