Fix collections in trash showing up in menus
New Collection menu and Add to Collection menu https://forums.zotero.org/discussion/115447/zotero-7-beta-deleted-collections-still-appear-in-the-ui
This commit is contained in:
parent
b9f0d26cee
commit
a612c1227e
4 changed files with 60 additions and 18 deletions
|
@ -285,6 +285,22 @@ describe("Zotero.Collection", function() {
|
|||
assert.lengthOf(childCollections, 0);
|
||||
})
|
||||
|
||||
it("should not include collections in trash by default", async function () {
|
||||
var collection1 = await createDataObject('collection');
|
||||
var collection2 = await createDataObject('collection', { parentID: collection1.id, deleted: true });
|
||||
|
||||
var childCollections = collection1.getChildCollections();
|
||||
assert.lengthOf(childCollections, 0);
|
||||
});
|
||||
|
||||
it("should include collections in trash if includeTrashed=true", async function () {
|
||||
var collection1 = await createDataObject('collection');
|
||||
var collection2 = await createDataObject('collection', { parentID: collection1.id, deleted: true });
|
||||
|
||||
var childCollections = collection1.getChildCollections(false, true);
|
||||
assert.lengthOf(childCollections, 1);
|
||||
});
|
||||
|
||||
it("should not include collections that have been deleted", function* () {
|
||||
var collection1 = yield createDataObject('collection');
|
||||
var collection2 = yield createDataObject('collection', { parentID: collection1.id });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue