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:
Abe Jellinek 2022-10-16 15:47:54 -04:00 committed by GitHub
parent f9a0622c30
commit c1bb910d1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 1 deletions

View file

@ -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);
});
})
})
})