Fix test failure after 26a5e2900a

This commit is contained in:
Dan Stillman 2022-07-11 05:19:05 -04:00
parent d3942ad1f0
commit 612fec8961

View file

@ -614,8 +614,13 @@ describe("Zotero.ItemTree", function() {
var item3 = await createDataObject('item', { title: title + " 5" });
var item4 = await createDataObject('item', { title: title + " 7" });
const colIndex = itemsView.tree._getColumns().findIndex(column => column.dataKey == 'title');
// Sort by title
var colIndex = itemsView.tree._getColumns().findIndex(column => column.dataKey == 'firstCreator');
await itemsView.tree._columns.toggleSort(colIndex);
await waitForItemsLoad(win);
colIndex = itemsView.tree._getColumns().findIndex(column => column.dataKey == 'title');
await itemsView.tree._columns.toggleSort(colIndex);
await waitForItemsLoad(win);
// Check initial sort order
assert.equal(itemsView.getRow(0).ref.getField('title'), title + " 1");