Fix editing of saved search in a group
This commit is contained in:
parent
8a915beaaa
commit
0016c5ecf8
|
@ -2007,7 +2007,7 @@ var ZoteroPane = new function()
|
||||||
// applicable, and pass it in. We only need the group that this search belongs
|
// 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.
|
// to, if any, since the library drop-down is disabled for saved searches.
|
||||||
if (Zotero.Libraries.get(s.libraryID).libraryType == 'group') {
|
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 = {
|
var io = {
|
||||||
dataIn: {
|
dataIn: {
|
||||||
|
|
|
@ -409,6 +409,23 @@ describe("ZoteroPane", function() {
|
||||||
var conditions = search.getConditions();
|
var conditions = search.getConditions();
|
||||||
assert.lengthOf(Object.keys(conditions), 3);
|
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() {
|
describe("#onCollectionSelected()", function() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user