Fix potential error in libraryTreeView::#_removeRow() test
This commit is contained in:
parent
48260e22a9
commit
91b0acac1e
|
@ -31,15 +31,15 @@ describe("Zotero.LibraryTreeView", function() {
|
||||||
it("should remove the last row", function* () {
|
it("should remove the last row", function* () {
|
||||||
var collection = yield createDataObject('collection');
|
var collection = yield createDataObject('collection');
|
||||||
yield waitForItemsLoad(win);
|
yield waitForItemsLoad(win);
|
||||||
var item1 = yield createDataObject('item', { collections: [collection.id] });
|
yield createDataObject('item', { collections: [collection.id] });
|
||||||
var item2 = yield createDataObject('item', { collections: [collection.id] });
|
yield createDataObject('item', { collections: [collection.id] });
|
||||||
|
|
||||||
var view = zp.itemsView;
|
var view = zp.itemsView;
|
||||||
assert.equal(view.getRowIndexByID(item2.id), 1);
|
var treeViewID = view.getRow(1).id;
|
||||||
zp.itemsView._removeRow(1);
|
zp.itemsView._removeRow(1);
|
||||||
|
|
||||||
assert.equal(view.rowCount, 1);
|
assert.equal(view.rowCount, 1);
|
||||||
assert.isFalse(view.getRowIndexByID(item2.id));
|
assert.isFalse(view.getRowIndexByID(treeViewID));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue
Block a user