www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 3ba2b40c4cf9b674bd887883a07432de81b15a43
parent 0a1629e9862f45467d096f8bb025406fc12d9506
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 24 Feb 2017 03:29:50 -0500

Remove obsolete Zotero.Libraries.isFilesEditable test after 88184b341

Diffstat:
Mtest/tests/librariesTest.js | 33---------------------------------
Mtest/tests/libraryTest.js | 9+++++++++
2 files changed, 9 insertions(+), 33 deletions(-)

diff --git a/test/tests/librariesTest.js b/test/tests/librariesTest.js @@ -162,42 +162,9 @@ describe("Zotero.Libraries", function() { }); }); describe("#isFilesEditable()", function() { - it("should always return true for user library", function() { - assert.isTrue(Zotero.Libraries.isFilesEditable(Zotero.Libraries.userLibraryID)); - }); - it("should always return true for publications library", function() { - assert.isTrue(Zotero.Libraries.isFilesEditable(Zotero.Libraries.publicationsLibraryID)); - }); it("should throw for invalid library ID", function() { assert.throws(Zotero.Libraries.isFilesEditable.bind(Zotero.Libraries, -1), /^Invalid library ID /); }); - - it("should not depend on editable", function* () { - let editableStartState = Zotero.Libraries.isEditable(group.libraryID), - filesEditableStartState = Zotero.Libraries.isFilesEditable(group.libraryID); - - // Test all combinations - // E: true, FE: true => true - yield Zotero.Libraries.setEditable(group.libraryID, true); - yield Zotero.Libraries.setFilesEditable(group.libraryID, true); - assert.isTrue(Zotero.Libraries.isFilesEditable(group.libraryID)); - - // E: false, FE: true => true - yield Zotero.Libraries.setEditable(group.libraryID, false); - assert.isTrue(Zotero.Libraries.isFilesEditable(group.libraryID)); - - // E: false, FE: false => false - yield Zotero.Libraries.setFilesEditable(group.libraryID, false); - assert.isFalse(Zotero.Libraries.isFilesEditable(group.libraryID)); - - // E: true, FE: false => false - yield Zotero.Libraries.setEditable(group.libraryID, true); - assert.isFalse(Zotero.Libraries.isFilesEditable(group.libraryID)); - - // Revert settings - yield Zotero.Libraries.setFilesEditable(group.libraryID, filesEditableStartState); - yield Zotero.Libraries.setEditable(group.libraryID, editableStartState); - }); }); describe("#setFilesEditable()", function() { it("should not allow changing files editable state of built-in libraries", function* () { diff --git a/test/tests/libraryTest.js b/test/tests/libraryTest.js @@ -102,6 +102,14 @@ describe("Zotero.Library", function() { }); describe("#filesEditable", function() { + it("should always return true for user library", function() { + assert.isTrue(Zotero.Libraries.userLibrary.filesEditable); + }); + + it("should always return true for publications library", function() { + assert.isTrue(Zotero.Libraries.get(Zotero.Libraries.publicationsLibraryID).filesEditable); + }); + it("should return files editable status", function() { let library = Zotero.Libraries.get(Zotero.Libraries.userLibraryID); assert.isTrue(library.filesEditable, 'user library is files editable'); @@ -118,6 +126,7 @@ describe("Zotero.Library", function() { assert.isFalse(library.filesEditable); assert.isFalse(Zotero.Libraries.isFilesEditable(library.libraryID), "sets files editable in cache to false"); }); + it("should not be settable for user and publications libraries", function* () { let library = Zotero.Libraries.get(Zotero.Libraries.userLibraryID); assert.throws(function() {library.filesEditable = false}, /^Cannot change _libraryFilesEditable for user library$/, "does not allow setting user library as not files editable");