diff --git a/front/core/components/smart-table/index.spec.js b/front/core/components/smart-table/index.spec.js index 5fd4c33b7..5a1be98e1 100644 --- a/front/core/components/smart-table/index.spec.js +++ b/front/core/components/smart-table/index.spec.js @@ -160,7 +160,7 @@ describe('Component smartTable', () => { describe('applySort()', () => { it('should call the $state go and model refresh without making changes on the model order', () => { controller.$state = { - go: jest.fn(), + go: jest.fn().mockReturnValue(new Promise(resolve => resolve())), current: { name: 'section' } @@ -171,13 +171,12 @@ describe('Component smartTable', () => { expect(controller.model.order).toBeUndefined(); expect(controller.$state.go).toHaveBeenCalled(); - expect(controller.refresh).toHaveBeenCalled(); }); it('should call the $state go and model refresh after setting model order according to the controller sortCriteria', () => { const orderBy = {field: 'myField', sortType: 'ASC'}; controller.$state = { - go: jest.fn(), + go: jest.fn().mockReturnValue(new Promise(resolve => resolve())), current: { name: 'section' } @@ -190,7 +189,6 @@ describe('Component smartTable', () => { expect(controller.model.order).toEqual(`${orderBy.field} ${orderBy.sortType}`); expect(controller.$state.go).toHaveBeenCalled(); - expect(controller.refresh).toHaveBeenCalled(); }); }); @@ -293,12 +291,10 @@ describe('Component smartTable', () => { controller.$inputsScope = { searchProps: {} }; - jest.spyOn(controller, 'refresh'); controller.defaultFilter(); expect(controller.model.addFilter).toHaveBeenCalled(); - expect(controller.refresh).toHaveBeenCalled(); }); });