www

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

commit 0016c5ecf8dae967f6df2272268d2dd73cbf615c
parent 8a915beaaafe5a7bc7d3c3f3b1e3cde1e7b69ff6
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 20 Oct 2016 22:55:42 -0400

Fix editing of saved search in a group

Diffstat:
Mchrome/content/zotero/zoteroPane.js | 2+-
Mtest/tests/zoteroPaneTest.js | 17+++++++++++++++++
2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -2007,7 +2007,7 @@ var ZoteroPane = new function() // applicable, and pass it in. We only need the group that this search belongs // to, if any, since the library drop-down is disabled for saved searches. if (Zotero.Libraries.get(s.libraryID).libraryType == 'group') { - groups.push(yield Zotero.Groups.getByLibraryID(s.libraryID)); + groups.push(Zotero.Groups.getByLibraryID(s.libraryID)); } var io = { dataIn: { diff --git a/test/tests/zoteroPaneTest.js b/test/tests/zoteroPaneTest.js @@ -409,6 +409,23 @@ describe("ZoteroPane", function() { var conditions = search.getConditions(); assert.lengthOf(Object.keys(conditions), 3); }); + + it("should edit a saved search in a group", function* () { + var group = yield getGroup(); + var search = yield createDataObject('search', { libraryID: group.libraryID }); + var promise = waitForWindow('chrome://zotero/content/searchDialog.xul', function (win) { + let searchBox = win.document.getElementById('search-box'); + var c = searchBox.search.getCondition( + searchBox.search.addCondition("title", "contains", "foo") + ); + searchBox.addCondition(c); + win.document.documentElement.acceptDialog(); + }); + yield zp.editSelectedCollection(); + yield promise; + var conditions = search.getConditions(); + assert.lengthOf(Object.keys(conditions), 3); + }); }); describe("#onCollectionSelected()", function() {