2022-08-11 00:19:45 -05:00
|
|
|
/////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
|
|
//
|
2023-01-02 00:23:55 -06:00
|
|
|
// Copyright (C) 2013 - 2023, The pgAdmin Development Team
|
2022-08-11 00:19:45 -05:00
|
|
|
// This software is released under the PostgreSQL Licence
|
|
|
|
//
|
|
|
|
//////////////////////////////////////////////////////////////
|
|
|
|
|
2023-10-23 07:13:17 -05:00
|
|
|
|
2022-08-11 00:19:45 -05:00
|
|
|
import React from 'react';
|
2023-10-23 07:13:17 -05:00
|
|
|
|
|
|
|
import { render } from '@testing-library/react';
|
|
|
|
import { BgProcessManagerProcessState } from '../../../pgadmin/misc/bgprocess/static/js/BgProcessConstants';
|
|
|
|
import BgProcessManager from '../../../pgadmin/misc/bgprocess/static/js/BgProcessManager';
|
2022-08-11 00:19:45 -05:00
|
|
|
import pgAdmin from 'sources/pgadmin';
|
|
|
|
import Processes from '../../../pgadmin/misc/bgprocess/static/js/Processes';
|
2023-10-23 07:13:17 -05:00
|
|
|
import { withBrowser } from '../genericFunctions';
|
2022-08-11 00:19:45 -05:00
|
|
|
|
|
|
|
|
|
|
|
const processData = {
|
|
|
|
acknowledge: null,
|
|
|
|
current_storage_dir: null,
|
|
|
|
desc: 'Doing some operation on the server \'PostgreSQL 12 (localhost:5432)\'',
|
|
|
|
details: {
|
|
|
|
cmd: '/Library/PostgreSQL/12/bin/mybin --testing',
|
|
|
|
message: 'Doing some detailed operation on the server \'PostgreSQL 12 (localhost:5432)\'...'
|
|
|
|
},
|
|
|
|
etime: null,
|
|
|
|
execution_time: 0.09,
|
|
|
|
exit_code: null,
|
|
|
|
id: '220803091429498400',
|
|
|
|
process_state: BgProcessManagerProcessState.PROCESS_STARTED,
|
|
|
|
stime: '2022-08-03T09:14:30.191940+00:00',
|
|
|
|
type_desc: 'Operation on the server',
|
|
|
|
utility_pid: 140391
|
|
|
|
};
|
|
|
|
|
|
|
|
describe('Proceses', ()=>{
|
|
|
|
beforeEach(()=>{
|
|
|
|
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
|
|
pgAdmin.Browser.BgProcessManager = new BgProcessManager(pgAdmin.Browser);
|
|
|
|
pgAdmin.Browser.BgProcessManager._procList = [processData];
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('ProcessDetails', ()=>{
|
2023-10-23 07:13:17 -05:00
|
|
|
const ProcesesWithBrowser = withBrowser(Processes);
|
2022-08-11 00:19:45 -05:00
|
|
|
let ctrlMount = (props)=>{
|
2023-10-23 07:13:17 -05:00
|
|
|
return render(<ProcesesWithBrowser {...props} />);
|
2022-08-11 00:19:45 -05:00
|
|
|
};
|
|
|
|
|
2023-10-23 07:13:17 -05:00
|
|
|
it('init', ()=>{
|
2022-08-11 00:19:45 -05:00
|
|
|
let ctrl = ctrlMount({});
|
2023-10-23 07:13:17 -05:00
|
|
|
expect(ctrl.container.querySelectorAll('[data-test="processes"]').length).toBe(1);
|
2022-08-11 00:19:45 -05:00
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|