move db tests cleanup test behind actual test
This commit is contained in:
parent
2af6cb4f6a
commit
a27f3ac3af
@ -48,18 +48,6 @@ export default function() {
|
|||||||
inst = null;
|
inst = null;
|
||||||
});
|
});
|
||||||
|
|
||||||
QUnit.test.if(
|
|
||||||
"cleanup works",
|
|
||||||
// not yet baseline widely available, should be in November 2026
|
|
||||||
// TODO: check in November 2026, make unconditional if possible then
|
|
||||||
"databases" in indexedDB,
|
|
||||||
async function(assert) {
|
|
||||||
let dbs = await indexedDB.databases();
|
|
||||||
assert.true(
|
|
||||||
dbs.every(({name}) => name !== WbDb.DB_NAME_TEST),
|
|
||||||
"no testing db");
|
|
||||||
});
|
|
||||||
|
|
||||||
QUnit.test("cannot call constructor", function(assert) {
|
QUnit.test("cannot call constructor", function(assert) {
|
||||||
assert.throws(
|
assert.throws(
|
||||||
function() { new WbDb(); },
|
function() { new WbDb(); },
|
||||||
@ -85,6 +73,18 @@ export default function() {
|
|||||||
assert.strictEqual(inst.db.version, WbDb.DB_VERSION, "correct version");
|
assert.strictEqual(inst.db.version, WbDb.DB_VERSION, "correct version");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test.if(
|
||||||
|
"cleanup works",
|
||||||
|
// not yet baseline widely available, should be in November 2026
|
||||||
|
// TODO: check in November 2026, make unconditional if possible then
|
||||||
|
"databases" in indexedDB,
|
||||||
|
async function(assert) {
|
||||||
|
let dbs = await indexedDB.databases();
|
||||||
|
assert.true(
|
||||||
|
dbs.every(({name}) => name !== WbDb.DB_NAME_TEST),
|
||||||
|
"no testing db");
|
||||||
|
});
|
||||||
|
|
||||||
QUnit.test("opening is blocked", async function(assert) {
|
QUnit.test("opening is blocked", async function(assert) {
|
||||||
let first = WbDb.get(true, 1);
|
let first = WbDb.get(true, 1);
|
||||||
await waitForChange(first);
|
await waitForChange(first);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user