Store API key in login manager, and add temp field in prefs
This commit is contained in:
parent
e03cf637b6
commit
d07756d68d
6 changed files with 167 additions and 65 deletions
|
@ -1,6 +1,25 @@
|
|||
"use strict";
|
||||
|
||||
describe("Zotero.Sync.Data.Local", function() {
|
||||
describe("#getAPIKey()/#setAPIKey()", function () {
|
||||
it("should get and set an API key", function* () {
|
||||
var apiKey1 = Zotero.Utilities.randomString(24);
|
||||
var apiKey2 = Zotero.Utilities.randomString(24);
|
||||
Zotero.Sync.Data.Local.setAPIKey(apiKey1);
|
||||
assert.equal(Zotero.Sync.Data.Local.getAPIKey(apiKey1), apiKey1);
|
||||
Zotero.Sync.Data.Local.setAPIKey(apiKey2);
|
||||
assert.equal(Zotero.Sync.Data.Local.getAPIKey(apiKey2), apiKey2);
|
||||
})
|
||||
|
||||
|
||||
it("should clear an API key by setting an empty string", function* () {
|
||||
var apiKey = Zotero.Utilities.randomString(24);
|
||||
Zotero.Sync.Data.Local.setAPIKey(apiKey);
|
||||
Zotero.Sync.Data.Local.setAPIKey("");
|
||||
assert.strictEqual(Zotero.Sync.Data.Local.getAPIKey(apiKey), "");
|
||||
})
|
||||
})
|
||||
|
||||
describe("#processSyncCacheForObjectType()", function () {
|
||||
var types = Zotero.DataObjectUtilities.getTypes();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue