Fix potential error in libraryTreeView::#_removeRow() test

This commit is contained in:
Dan Stillman 2016-07-19 20:31:06 -04:00
parent 48260e22a9
commit 91b0acac1e

View file

@ -31,15 +31,15 @@ describe("Zotero.LibraryTreeView", function() {
it("should remove the last row", function* () {
var collection = yield createDataObject('collection');
yield waitForItemsLoad(win);
var item1 = yield createDataObject('item', { collections: [collection.id] });
var item2 = yield createDataObject('item', { collections: [collection.id] });
yield createDataObject('item', { collections: [collection.id] });
yield createDataObject('item', { collections: [collection.id] });
var view = zp.itemsView;
assert.equal(view.getRowIndexByID(item2.id), 1);
var treeViewID = view.getRow(1).id;
zp.itemsView._removeRow(1);
assert.equal(view.rowCount, 1);
assert.isFalse(view.getRowIndexByID(item2.id));
assert.isFalse(view.getRowIndexByID(treeViewID));
});
});
})