Add test for 4.0 → 5.0 DB upgrade

With a mechanism for specifying a zipped DB copy to use as the initial
DB when resetting the DB in tests
This commit is contained in:
Dan Stillman 2021-08-16 19:50:44 -04:00
parent 0f96c20f3c
commit eac98d1c2e
3 changed files with 33 additions and 2 deletions

View file

@ -303,4 +303,24 @@ describe("Zotero.Schema", function() {
await assert.isTrue(await Zotero.Schema.integrityCheck());
});
})
describe("Database Upgrades", function () {
after(async function () {
await resetDB({
thisArg: this,
skipBundledFiles: true,
});
});
it("should upgrade 4.0 database", async function () {
await resetDB({
thisArg: this,
skipBundledFiles: true,
dbFile: OS.Path.join(getTestDataDirectory().path, 'zotero-4.0.sqlite.zip')
});
// Make sure we can open the Zotero pane without errors
win = await loadZoteroPane();
win.close();
});
});
})