Fix test breakage after 5ff2a59f87
And remove all instances of `publicationsLibraryID`
This commit is contained in:
parent
5ff2a59f87
commit
6d18b46165
8 changed files with 41 additions and 142 deletions
|
@ -5,7 +5,6 @@ describe("Zotero.Libraries", function() {
|
|||
before(function* () {
|
||||
builtInLibraries = [
|
||||
Zotero.Libraries.userLibraryID,
|
||||
Zotero.Libraries.publicationsLibraryID
|
||||
];
|
||||
|
||||
group = yield createGroup({ name: groupName });
|
||||
|
@ -16,11 +15,6 @@ describe("Zotero.Libraries", function() {
|
|||
assert(Number.isInteger(Zotero.Libraries.userLibraryID), ".userLibraryID is an integer");
|
||||
assert.isAbove(Zotero.Libraries.userLibraryID, 0);
|
||||
});
|
||||
it("should provide publications library ID as .publicationsLibraryID", function() {
|
||||
assert.isDefined(Zotero.Libraries.publicationsLibraryID);
|
||||
assert(Number.isInteger(Zotero.Libraries.publicationsLibraryID), ".publicationsLibraryID is an integer");
|
||||
assert.isAbove(Zotero.Libraries.publicationsLibraryID, 0);
|
||||
});
|
||||
|
||||
describe("#getAll()", function() {
|
||||
it("should return an array of Zotero.Library instances", function() {
|
||||
|
@ -43,7 +37,6 @@ describe("Zotero.Libraries", function() {
|
|||
|
||||
// Check sort
|
||||
assert.equal(ids[0], Zotero.Libraries.userLibraryID);
|
||||
assert.equal(ids[1], Zotero.Libraries.publicationsLibraryID);
|
||||
|
||||
var last = "";
|
||||
var collation = Zotero.getLocaleCollation();
|
||||
|
@ -76,7 +69,6 @@ describe("Zotero.Libraries", function() {
|
|||
describe("#getName()", function() {
|
||||
it("should return correct library name for built-in libraries", function() {
|
||||
assert.equal(Zotero.Libraries.getName(Zotero.Libraries.userLibraryID), Zotero.getString('pane.collections.library'), "user library name is correct");
|
||||
assert.equal(Zotero.Libraries.getName(Zotero.Libraries.publicationsLibraryID), Zotero.getString('pane.collections.publications'), "publications library name is correct");
|
||||
});
|
||||
it("should return correct name for a group library", function() {
|
||||
assert.equal(Zotero.Libraries.getName(group.libraryID), groupName);
|
||||
|
@ -88,7 +80,6 @@ describe("Zotero.Libraries", function() {
|
|||
describe("#getType()", function() {
|
||||
it("should return correct library type for built-in libraries", function() {
|
||||
assert.equal(Zotero.Libraries.getType(Zotero.Libraries.userLibraryID), 'user', "user library type is correct");
|
||||
assert.equal(Zotero.Libraries.getType(Zotero.Libraries.publicationsLibraryID), 'publications', "publications library type is correct");
|
||||
});
|
||||
it("should return correct library type for a group library", function() {
|
||||
assert.equal(Zotero.Libraries.getType(group.libraryID), 'group');
|
||||
|
@ -101,9 +92,6 @@ describe("Zotero.Libraries", function() {
|
|||
it("should always return true for user library", function() {
|
||||
assert.isTrue(Zotero.Libraries.isEditable(Zotero.Libraries.userLibraryID));
|
||||
});
|
||||
it("should always return true for publications library", function() {
|
||||
assert.isTrue(Zotero.Libraries.isEditable(Zotero.Libraries.publicationsLibraryID));
|
||||
});
|
||||
it("should return correct state for a group library", function* () {
|
||||
group.editable = true;
|
||||
yield group.saveTx();
|
||||
|
@ -209,7 +197,6 @@ describe("Zotero.Libraries", function() {
|
|||
describe("#hasTrash()", function() {
|
||||
it("should return true for all library types", function() {
|
||||
assert.isTrue(Zotero.Libraries.hasTrash(Zotero.Libraries.userLibraryID));
|
||||
assert.isTrue(Zotero.Libraries.hasTrash(Zotero.Libraries.publicationsLibraryID));
|
||||
assert.isTrue(Zotero.Libraries.hasTrash(group.libraryID));
|
||||
});
|
||||
it("should throw for invalid library ID", function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue