Clear sync error and start sync after logging in in prefs (#2802)
Also fixes an existing error due to an argumentless call to Zotero.Sync.Runner.updateIcons() in ZoteroPane.
This commit is contained in:
parent
f9a0622c30
commit
c1bb910d1c
3 changed files with 27 additions and 1 deletions
|
@ -98,7 +98,22 @@ describe("Sync Preferences", function () {
|
|||
yield assert.eventually.equal(Zotero.Sync.Data.Local.getAPIKey(), apiKey);
|
||||
assert.equal(doc.getElementById('sync-unauthorized').getAttribute('hidden'), 'true');
|
||||
});
|
||||
|
||||
it("should clear sync errors from the toolbar after logging in", async function () {
|
||||
let win = await loadZoteroPane();
|
||||
after(function () {
|
||||
win.close();
|
||||
});
|
||||
|
||||
let syncError = win.document.getElementById('zotero-tb-sync-error');
|
||||
|
||||
Zotero.Sync.Runner.updateIcons(new Error("a sync error"));
|
||||
assert.isFalse(syncError.hidden);
|
||||
|
||||
getAPIKeyFromCredentialsStub.resolves(apiResponse);
|
||||
await setCredentials("Username", "correctPassword");
|
||||
assert.isTrue(syncError.hidden);
|
||||
});
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue