Fix test failure after a8ed30ce8

We added a `toggleSort()` call on the title, so then when called again
it reverses the direction. To avoid, sort by creator and then title in
the second test.
This commit is contained in:
Dan Stillman 2022-07-08 06:44:10 -04:00
parent 92a1a43cbb
commit fea99bf8f8

View file

@ -616,7 +616,10 @@ 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 creator and then title, to make sure we're sorting by title ascending
var colIndex = itemsView.tree._getColumns().findIndex(column => column.dataKey == 'firstCreator');
await itemsView.tree._columns.toggleSort(colIndex);
colIndex = itemsView.tree._getColumns().findIndex(column => column.dataKey == 'title');
await itemsView.tree._columns.toggleSort(colIndex);
// Check initial sort order