Update resetDB test for async DB
This commit is contained in:
parent
e8b7b38290
commit
71d2aa9337
1 changed files with 10 additions and 8 deletions
|
@ -1,12 +1,14 @@
|
|||
describe("Support Functions for Unit Testing", function() {
|
||||
describe("resetDB", function() {
|
||||
it("should restore the DB to factory settings", function() {
|
||||
this.timeout(10000);
|
||||
var quickstart = Zotero.Items.erase(1);
|
||||
assert.equal(Zotero.Items.get(1), false);
|
||||
return resetDB().then(function() {
|
||||
assert.equal(Zotero.Items.get(1).getField("url"), "http://zotero.org/support/quick_start_guide");
|
||||
});
|
||||
});
|
||||
it("should restore the DB to factory settings", Zotero.Promise.coroutine(function* () {
|
||||
this.timeout(30000);
|
||||
yield Zotero.Items.erase(1);
|
||||
assert.isFalse(yield Zotero.Items.getAsync(1));
|
||||
yield resetDB();
|
||||
var item = yield Zotero.Items.getAsync(1);
|
||||
assert.isObject(item);
|
||||
yield item.loadItemData();
|
||||
assert.equal(item.getField("url"), "https://www.zotero.org/support/quick_start_guide");
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue