fix: frontTest
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
76865fc7b6
commit
15429293dd
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue