Skip to content

test(e2e): isolate JSON import fixture timestamps - #1290

Merged
khaira777 merged 1 commit into
mainfrom
fm/ship-t2-e2e-import-fixture-isolation
Oct 22, 2026
Merged

khaira777 merged 1 commit into
mainfrom
fm/ship-t2-e2e-import-fixture-isolation

Conversation

@khaira777

@khaira777 khaira777 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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-canonical new Date().toISOString() (YYYY-MM-DDTHH:MM:SS.sssZ) fixture timestamps and clean up the imported fixture rows in finally so the test never pollutes /api/orders pagination ordering in frontend/e2e/orders-master-detail.spec.ts.

What Changed

  • Replaced new Date().toISOString() timestamps on the imported products, inventory_movements, customers, and orders fixture rows in frontend/e2e/database-export-import.spec.ts with a fixed canonical UTC timestamp (2020-01-01 00:00:00).
  • Added a PATCH /api/orders/:id/status call in the test's finally block 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.ts and e2e/orders-master-detail.spec.ts sequentially on a shared live E2E server instance (all 27 tests passing), and captured browser screenshots and API pagination evidence confirming that the canonical 2020-01-01 00:00:00 fixture timestamp and finally cleanup prevent imported fixture rows from polluting /api/orders pagination ordering.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Owner exports a JSON database snapshot from Settings -> Backup & Data that excludes FTS shadow tables and virtual columns and restores cleanly in an isolated instance ✅ pass live ~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/database-export-import.png
Owner imports a contaminated JSON payload with canonical UTC timestamps ('2020-01-01 00:00:00'), FTS search indexes rebuild so the imported order is searchable by order number and customer name, and f… ✅ pass live ~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/orders-pagination-isolation-evidence.json
Running database-export-import.spec.ts followed by orders-master-detail.spec.ts on the shared E2E server does not pollute /api/orders pagination ordering or displace the 15th active order off page 1 ✅ pass live ~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/orders-master-detail-after-import.png

Settings Backup & Data JSON export/import verification screenshot
Orders master-detail split view page 1 after JSON import fixture cleanup

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 } }

{
  "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.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Owner exports a JSON database snapshot from Settings -> Backup & Data that excludes FTS shadow tables and virtual columns and restores cleanly in an isolated instance ✅ pass live ~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/database-export-import.png
Owner imports a contaminated JSON payload with canonical UTC timestamps ('2020-01-01 00:00:00'), FTS search indexes rebuild so the imported order is searchable by order number and customer name, and f… ✅ pass live ~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/orders-pagination-isolation-evidence.json
Running database-export-import.spec.ts followed by orders-master-detail.spec.ts on the shared E2E server does not pollute /api/orders pagination ordering or displace the 15th active order off page 1 ✅ pass live ~/.no-mistakes/evidence/01M5J409ANKVXHQ13GABHRR549/orders-master-detail-after-import.png
  • npm ci
  • npm run build && npm run build:frontend
  • cd 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.ts
  • Live Playwright + API verification of contaminated JSON import, FTS order/customer search, finally order cancellation/product deletion, and 15-order pagination boundary on /orders (view=active and view=all) against node tests/e2e-server.cjs
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@khaira777 khaira777 changed the title test(e2e): use canonical UTC timestamps and isolate shared JSON import fixture test(e2e): isolate JSON import fixture timestamps Oct 22, 2026
@khaira777

Copy link
Copy Markdown
Contributor Author

@greptileai review this at apex

@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 4/5 Tier: 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

  1. P2 Failed cleanup goes unnoticed ▶

Summary

Updates the JSON import test to use fixed canonical UTC fixture dates and cancel its imported order during teardown.

  • The import test uses fixed timestamps and cancels its order afterward.

Reviews (1) · Last reviewed commit: "test(e2e): isolate JSON import fixture t..." · Reviewed by Greptile

@khaira777
khaira777 force-pushed the fm/ship-t2-e2e-import-fixture-isolation branch from 2473e45 to b76140b Compare October 22, 2026 16:30
@khaira777
khaira777 merged commit 9c703c1 into main Oct 22, 2026
23 checks passed
@khaira777
khaira777 deleted the fm/ship-t2-e2e-import-fixture-isolation branch October 22, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(e2e): use canonical UTC timestamps and isolate shared JSON import fixture

1 participant