mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-25 18:20:20 -06:00
parent
2cdee919c1
commit
8d1868305d
@ -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', ()=>{
|
||||
|
Loading…
Reference in New Issue
Block a user