2015-03-09 18:25:49 +00:00
|
|
|
describe("Support Functions for Unit Testing", function() {
|
|
|
|
describe("resetDB", function() {
|
2015-04-15 05:32:40 +00:00
|
|
|
it("should restore the DB to factory settings", function* () {
|
2015-05-22 03:48:58 +00:00
|
|
|
this.timeout(60000);
|
2015-04-15 04:40:05 +00:00
|
|
|
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");
|
2015-04-15 05:32:40 +00:00
|
|
|
});
|
2015-03-09 18:25:49 +00:00
|
|
|
});
|
|
|
|
});
|