commit 71d2aa9337928cd0adbb0186893c122426e0a08a
parent e8b7b38290d1bb43f8db6d7f05969ad47644bbf2
Author: Dan Stillman <dstillman@zotero.org>
Date: Wed, 15 Apr 2015 00:40:05 -0400
Update resetDB test for async DB
Diffstat:
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/test/tests/support.js b/test/tests/support.js
@@ -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");
+ }));
});
});