mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-19 13:36:48 +00:00
5049f3762f
Each version() of the offline database runs once, on a user's device, when a new bundle opens what an older one wrote. None of them ran in CI: the v3 blob cache backfill and the v8 area-fingerprint reset had never been exercised against an older database. The new test builds the database as each previous version left it in fake-indexeddb, seeds a row into every table it had, opens it with the current schema and checks that the rows survived and that the version did what it is for. A guard reads the declared versions from offlineDb.ts and fails on a duplicate, on a version without an upgrade case, or on stores the history fixture does not reproduce. TrekOfflineDb is exported so the test can open a named database with it.