Port Import/Export dialog to React. Fixes #7017.

This commit is contained in:
Yogesh Mahajan
2022-01-21 11:48:52 +05:30
committed by Akshay Joshi
parent 1013d7ccdd
commit c983aae881
10 changed files with 409 additions and 616 deletions

View File

@@ -0,0 +1,50 @@
/////////////////////////////////////////////////////////////
//
// pgAdmin 4 - PostgreSQL Tools
//
// Copyright (C) 2013 - 2022, The pgAdmin Development Team
// This software is released under the PostgreSQL Licence
//
//////////////////////////////////////////////////////////////
import React from 'react';
import '../helper/enzyme.helper';
import { createMount } from '@material-ui/core/test-utils';
import SchemaView from '../../../pgadmin/static/js/SchemaView';
import ImportExportSchema, {getFileInfoSchema, getMiscellaneousSchema} from '../../../pgadmin/tools/import_export/static/js/import_export.ui';
describe('ImportExportSchema', ()=>{
let mount;
beforeAll(()=>{
mount = createMount();
});
afterAll(() => {
mount.cleanUp();
});
let importExportSchemaObj = new ImportExportSchema(
()=>getFileInfoSchema(),
()=>getMiscellaneousSchema(),
{columns: ()=>[]}
);
it('start import export', ()=>{
mount(<SchemaView
formType='dialog'
schema={importExportSchemaObj}
viewHelperProps={{
mode: 'create',
}}
onSave={()=>{/*This is intentional (SonarQube)*/}}
onClose={()=>{/*This is intentional (SonarQube)*/}}
onHelp={()=>{/*This is intentional (SonarQube)*/}}
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
confirmOnCloseReset={false}
hasSQL={false}
disableSqlHelp={false}
disableDialogHelp={false}
/>);
});
});