Make test more independent of db state
If there are library ids above 9 string sorting may not put the highest id last in the array.
This commit is contained in:
parent
07464d5c84
commit
aa94a62a74
1 changed files with 1 additions and 1 deletions
|
@ -62,7 +62,7 @@ describe("Zotero.Libraries", function() {
|
|||
});
|
||||
it("should return false for a non-existing ID", function() {
|
||||
assert.isFalse(Zotero.Libraries.exists(-1), "returns boolean false for a negative ID");
|
||||
let badID = Zotero.Libraries.getAll().map(library => library.libraryID).sort().pop() + 1;
|
||||
let badID = Zotero.Libraries.getAll().map(lib => lib.libraryID).reduce((a, b) => (a < b ? b : a)) + 1;
|
||||
assert.isFalse(Zotero.Libraries.exists(badID), "returns boolean false for a non-existent positive ID");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue