Don't change selection unnecessarily when creating trashed item
This commit is contained in:
parent
27f6f018d3
commit
0d1d4ee5cb
2 changed files with 28 additions and 24 deletions
|
@ -116,6 +116,23 @@ describe("Zotero.ItemTreeView", function() {
|
|||
assert.equal(selected[0], existingItemID);
|
||||
});
|
||||
|
||||
it("shouldn't change selection outside of trash if new trashed item is created with skipSelect", function* () {
|
||||
yield selectLibrary(win);
|
||||
yield waitForItemsLoad(win);
|
||||
|
||||
itemsView.selection.clearSelection();
|
||||
|
||||
var item = createUnsavedDataObject('item');
|
||||
item.deleted = true;
|
||||
var id = yield item.saveTx({
|
||||
skipSelect: true
|
||||
});
|
||||
|
||||
// Nothing should be selected
|
||||
selected = itemsView.getSelectedItems(true);
|
||||
assert.lengthOf(selected, 0);
|
||||
})
|
||||
|
||||
it("shouldn't select a modified item", function* () {
|
||||
// Create item
|
||||
var item = new Zotero.Item('book');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue