Ammends
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-01-20 10:43:03 +01:00
parent 52d7b4f600
commit 7a5e7b4c20
2 changed files with 3 additions and 2 deletions

View File

@ -246,7 +246,7 @@ export default class SmartTable extends Component {
if (!existingCriteria) {
const priority = this.sortCriteria.length + 1;
this.sortCriteria.push({field: field, sortType: 'ASC', priority: 1});
this.sortCriteria.push({field: field, sortType: 'ASC', priority: priority});
element.classList.remove('desc');
element.classList.add('asc');

View File

@ -116,9 +116,10 @@ describe('Component smartTable', () => {
expect(firstSortCriteria.field).toEqual('test1');
expect(firstSortCriteria.sortType).toEqual('ASC');
expect(firstSortCriteria.priority).toEqual(1);
expect(secondSortCriteria.field).toEqual('id');
expect(secondSortCriteria.sortType).toEqual('DESC');
expect(firstSortCriteria.priority).toEqual(2);
expect(secondSortCriteria.priority).toEqual(2);
});
});