Skip to content

Commit

Permalink
Repro of issue #1418
Browse files Browse the repository at this point in the history
  • Loading branch information
dfahlander committed Oct 27, 2021
1 parent 46a430f commit 40ea83c
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion test/tests-upgrading.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ test("upgrade", (assert) => {
db.version(6).stores({ store1: "++id,*email" });
db.version(7).stores({ store2: "uuid" });
// Deleting a version.
db.version(8).stores({ store1: null });
db.version(8).stores({store1: null });
return db.open().then(() => {
ok(true, "Could upgrade to version 8 - deleting an object store");
checkVersion(8);
Expand Down Expand Up @@ -826,3 +826,37 @@ promisedTest(
}
}
);


promisedTest(
"Issue 1418 - Not deleting all object stores",
async () => {
const DBNAME = "issue1418";
await Dexie.delete(DBNAME);
let db = new Dexie(DBNAME);
db.version(1).stores({
a: '++',
b: '++',
c: '++',
d: '++',
e: '++'
});
await db.open();
equal(db.idbdb.objectStoreNames.length, 5, "There are 5 object stores");
db.close();

db = new Dexie(DBNAME);
db.version(2).stores({
a: null,
b: null,
c: null,
d: null,
e: '++'
});
await db.open();
equal(db.idbdb.objectStoreNames.length, 1, "There is only one object store now");
db.close();
await Dexie.delete(DBNAME);
}
);

0 comments on commit 40ea83c

Please sign in to comment.