Don't change selection unnecessarily when creating trashed item

This commit is contained in:
Dan Stillman 2015-06-23 16:56:10 -04:00
parent 27f6f018d3
commit 0d1d4ee5cb
2 changed files with 28 additions and 24 deletions

View file

@ -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');