Fix test failures
This commit is contained in:
parent
1c90a77298
commit
88a1827332
2 changed files with 19 additions and 6 deletions
|
@ -22,20 +22,33 @@ describe("Zotero.Sync.Data.Local", function() {
|
|||
|
||||
|
||||
describe("#checkUser()", function () {
|
||||
var win;
|
||||
|
||||
beforeEach(function* () {
|
||||
win = yield loadBrowserWindow();
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
win.close();
|
||||
});
|
||||
|
||||
it("should prompt for user update and perform on accept", function* () {
|
||||
yield Zotero.Users.setCurrentUserID(1);
|
||||
yield Zotero.Users.setCurrentUsername("A");
|
||||
|
||||
var handled = false;
|
||||
waitForDialog(function (dialog) {
|
||||
var text = dialog.document.documentElement.textContent;
|
||||
var matches = text.match(/'[^']*'/g);
|
||||
var matches = text.match(/‘[^’]*’/g);
|
||||
assert.equal(matches.length, 4);
|
||||
assert.equal(matches[0], "'A'");
|
||||
assert.equal(matches[1], "'B'");
|
||||
assert.equal(matches[2], "'B'");
|
||||
assert.equal(matches[3], "'A'");
|
||||
assert.equal(matches[0], "‘A’");
|
||||
assert.equal(matches[1], "‘B’");
|
||||
assert.equal(matches[2], "‘B’");
|
||||
assert.equal(matches[3], "‘A’");
|
||||
handled = true;
|
||||
});
|
||||
var cont = yield Zotero.Sync.Data.Local.checkUser(win, 2, "B");
|
||||
assert.isTrue(handled);
|
||||
assert.isTrue(cont);
|
||||
|
||||
assert.equal(Zotero.Users.getCurrentUserID(), 2);
|
||||
|
|
|
@ -856,7 +856,7 @@ describe("Zotero.Sync.Storage.Mode.ZFS", function () {
|
|||
}));
|
||||
assert.ok(e);
|
||||
assert.equal(e.errorType, 'warning');
|
||||
assert.include(e.message, 'would exceed your');
|
||||
assert.include(e.message, 'test.png');
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue