Fix sorting by Item Type and feed item itemID

Regression from a8ed30ce80
This commit is contained in:
Dan Stillman 2022-07-10 17:31:01 -04:00
parent cba70856b7
commit 3ab661b628
2 changed files with 18 additions and 7 deletions

View file

@ -152,7 +152,7 @@ describe("Zotero.ItemTree", function() {
})
describe("#getSortFields()", function () {
before(async function () {
beforeEach(async function () {
itemsView = zp.itemsView;
// Sort by title
@ -183,6 +183,15 @@ describe("Zotero.ItemTree", function() {
// fallbackSort pref with title moved to beginning
assert.sameMembers(['title', 'firstCreator', 'date', 'dateAdded'], fields);
});
it("should sort by item type", async function () {
// Sort by item type
const colIndex = itemsView.tree._getColumns().findIndex(column => column.dataKey == 'itemType');
await itemsView.tree._columns.toggleSort(colIndex);
var fields = itemsView.getSortFields();
assert.sameMembers(['itemType', 'firstCreator', 'date', 'title', 'dateAdded'], fields);
});
});
describe("#notify()", function () {