Skip to content

Commit

Permalink
fix(ESSNTL-5092): Fix sorting by Total systems (/groups) (#1944)
Browse files Browse the repository at this point in the history
  • Loading branch information
gkarat authored Jul 24, 2023
1 parent d42e7e0 commit 6a6c6a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions src/components/GroupsTable/GroupsTable.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ describe('url search parameters', () => {
});

it('applies sorting', () => {
mountTable('/?order_by=host_ids&order_how=desc');
mountTable('/?order_by=host_count&order_how=desc');

checkSorting('Total systems', 'descending', 'host_ids');
checkSorting('Total systems', 'descending', 'host_count');
});
});

Expand All @@ -194,13 +194,15 @@ describe('sorting', () => {
cy.wait('@getGroups'); // first initial request
});

_.zip(['name', 'host_ids'], SORTABLE_HEADERS).forEach(([category, label]) => {
SORTING_ORDERS.forEach((order) => {
it(`${order} by ${label}`, () => {
checkSorting(label, order, category);
_.zip(['name', 'host_count'], SORTABLE_HEADERS).forEach(
([category, label]) => {
SORTING_ORDERS.forEach((order) => {
it(`${order} by ${label}`, () => {
checkSorting(label, order, category);
});
});
});
});
}
);
});

describe('filtering', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/GroupsTable/GroupsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const GROUPS_TABLE_COLUMNS = [
const GROUPS_TABLE_COLUMNS_TO_URL = {
0: '', // reserved for selection boxes
1: 'name',
2: 'host_ids',
2: 'host_count',
3: 'updated_at',
};

Expand Down

0 comments on commit 6a6c6a8

Please sign in to comment.