From 7a5e7b4c20869abbaf37de4ea944c18343ebe4b5 Mon Sep 17 00:00:00 2001 From: joan Date: Thu, 20 Jan 2022 10:43:03 +0100 Subject: [PATCH] Ammends --- front/core/components/smart-table/index.js | 2 +- front/core/components/smart-table/index.spec.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/front/core/components/smart-table/index.js b/front/core/components/smart-table/index.js index 8d96ffd79..b0b4d90dc 100644 --- a/front/core/components/smart-table/index.js +++ b/front/core/components/smart-table/index.js @@ -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'); diff --git a/front/core/components/smart-table/index.spec.js b/front/core/components/smart-table/index.spec.js index b947f3ad1..720e24c7e 100644 --- a/front/core/components/smart-table/index.spec.js +++ b/front/core/components/smart-table/index.spec.js @@ -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); }); });