Fixed Jasmine test cases.

refs #7313
This commit is contained in:
Aditya Toshniwal 2022-07-21 15:45:51 +05:30 committed by Akshay Joshi
parent 2cdee919c1
commit 8d1868305d

View File

@ -100,6 +100,7 @@ describe('FileManger', ()=>{
networkMock = new MockAdapter(axios);
networkMock.onPost('/file_manager/init').reply(200, {'data': configData});
networkMock.onPost(`/file_manager/filemanager/${transId}/`).reply(200, {data: {result: files}});
networkMock.onPost(`/file_manager/save_file_dialog_view/${transId}`).reply(200, {});
networkMock.onDelete(`/file_manager/delete_trans_id/${transId}`).reply(200, {});
});
@ -135,19 +136,16 @@ describe('FileManger', ()=>{
expect(ctrl.find('ListView').length).toBe(1);
expect(ctrl.find('GridView').length).toBe(0);
expect(ctrl.find('InputText[data-label="file-path"]').prop('value')).toBe('/home/current');
ctrl?.unmount();
let config = {...configData};
config.options.defaultViewMode = 'grid';
networkMock.onPost('/file_manager/init').reply(200, {'data': config});
ctrl = ctrlMount({});
ctrl.find('button[name="menu-options"]').simulate('click');
ctrl.update();
ctrl.find('Memo(MenuItem)[data-label="Grid View"]').simulate('click');
setTimeout(()=>{
ctrl.update();
expect(ctrl.find('ListView').length).toBe(0);
expect(ctrl.find('GridView').length).toBe(1);
ctrl?.unmount();
done();
}, 0);
}, 500);
}, 500);
}, 0);
});
describe('getComparator', ()=>{