Fixed code smell 'Update this function so that its implementation is not identical' reported by SonarQube.
parent
37d82d457c
commit
1a89c1f85f
|
@ -467,6 +467,16 @@ define([
|
||||||
return `<div class="no_folder_found">${lg.could_not_retrieve_folder}</div>`;
|
return `<div class="no_folder_found">${lg.could_not_retrieve_folder}</div>`;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var getCapClasses = function(item_data, capabilities) {
|
||||||
|
let capClasses = '';
|
||||||
|
capClasses = Object.keys(capabilities).map(function(cap) {
|
||||||
|
if (has_capability(item_data, capabilities[cap])) {
|
||||||
|
return 'cap_' + capabilities[cap];
|
||||||
|
}
|
||||||
|
}).join(' ');
|
||||||
|
return capClasses;
|
||||||
|
};
|
||||||
|
|
||||||
var getGridView = function(data, capabilities) {
|
var getGridView = function(data, capabilities) {
|
||||||
let ret_ele = '<ul id="contents" class="grid">',
|
let ret_ele = '<ul id="contents" class="grid">',
|
||||||
no_data = _.isEmpty(data);
|
no_data = _.isEmpty(data);
|
||||||
|
@ -481,11 +491,7 @@ define([
|
||||||
icon_type = '',
|
icon_type = '',
|
||||||
cap_classes = '';
|
cap_classes = '';
|
||||||
|
|
||||||
cap_classes = Object.keys(capabilities).map(function(cap) {
|
cap_classes = getCapClasses(item_data, capabilities);
|
||||||
if (has_capability(item_data, capabilities[cap])) {
|
|
||||||
return 'cap_' + capabilities[cap];
|
|
||||||
}
|
|
||||||
}).join(' ');
|
|
||||||
|
|
||||||
item_data.Capabilities = capabilities;
|
item_data.Capabilities = capabilities;
|
||||||
bindToolbar(item_data);
|
bindToolbar(item_data);
|
||||||
|
@ -581,11 +587,7 @@ define([
|
||||||
class_type = '',
|
class_type = '',
|
||||||
cap_classes = '';
|
cap_classes = '';
|
||||||
|
|
||||||
cap_classes = Object.keys(capabilities).map(function(cap) {
|
cap_classes = getCapClasses(item_data, capabilities);
|
||||||
if (has_capability(item_data, capabilities[cap])) {
|
|
||||||
return 'cap_' + capabilities[cap];
|
|
||||||
}
|
|
||||||
}).join(' ');
|
|
||||||
|
|
||||||
item_data.Capabilities = capabilities;
|
item_data.Capabilities = capabilities;
|
||||||
bindToolbar(item_data);
|
bindToolbar(item_data);
|
||||||
|
|
|
@ -167,6 +167,13 @@ define([
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var raiseError = function() {
|
||||||
|
Notify.alert(
|
||||||
|
gettext('Debugger Error'),
|
||||||
|
gettext('Unable to set the arguments on the server')
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return function(debugInfo, restartDebug, isEdbProc, transId) {
|
return function(debugInfo, restartDebug, isEdbProc, transId) {
|
||||||
if (!Alertify.debuggerInputArgsDialog) {
|
if (!Alertify.debuggerInputArgsDialog) {
|
||||||
Alertify.dialog('debuggerInputArgsDialog', function factory() {
|
Alertify.dialog('debuggerInputArgsDialog', function factory() {
|
||||||
|
@ -857,12 +864,7 @@ define([
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.done(function() {/*This is intentional (SonarQube)*/})
|
.done(function() {/*This is intentional (SonarQube)*/})
|
||||||
.fail(function() {
|
.fail(raiseError);
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Unable to set the arguments on the server')
|
|
||||||
);
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.fail(function(er) {
|
.fail(function(er) {
|
||||||
Notify.alert(
|
Notify.alert(
|
||||||
|
@ -907,13 +909,7 @@ define([
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
.done(function() {/*This is intentional (SonarQube)*/})
|
.done(function() {/*This is intentional (SonarQube)*/})
|
||||||
.fail(function() {
|
.fail(raiseError);
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Unable to set the arguments on the server')
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -306,6 +306,13 @@ define([
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
raisePollingError: function() {
|
||||||
|
Notify.alert(
|
||||||
|
gettext('Debugger Error'),
|
||||||
|
gettext('Error while polling result.')
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
// Get the stack information of the functions and update the grid
|
// Get the stack information of the functions and update the grid
|
||||||
GetStackInformation: function(trans_id) {
|
GetStackInformation: function(trans_id) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -442,12 +449,7 @@ define([
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function() {
|
.fail(self.raisePollingError());
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Error while polling result.')
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}, poll_timeout);
|
}, poll_timeout);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -621,12 +623,7 @@ define([
|
||||||
pgTools.DirectDebug.is_polling_required = false;
|
pgTools.DirectDebug.is_polling_required = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function() {
|
.fail(self.raisePollingError());
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Error while polling result.')
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}, poll_end_timeout);
|
}, poll_end_timeout);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
@ -685,12 +682,7 @@ define([
|
||||||
self.poll_end_execution_result(trans_id);
|
self.poll_end_execution_result(trans_id);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function() {
|
.fail(self.raisePollingError());
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Error while polling result.')
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function(xhr) {
|
.fail(function(xhr) {
|
||||||
|
@ -1479,6 +1471,20 @@ define([
|
||||||
*/
|
*/
|
||||||
var DirectDebug = function() {/*This is intentional (SonarQube)*/};
|
var DirectDebug = function() {/*This is intentional (SonarQube)*/};
|
||||||
|
|
||||||
|
var raiseJSONError = function(xhr) {
|
||||||
|
try {
|
||||||
|
var err = JSON.parse(xhr.responseText);
|
||||||
|
if (err.success == 0) {
|
||||||
|
Notify.alert(gettext('Debugger Error'), err.errormsg);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Notify.alert(
|
||||||
|
gettext('Debugger Error'),
|
||||||
|
gettext('Error while starting debugging listener.')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
_.extend(DirectDebug.prototype, {
|
_.extend(DirectDebug.prototype, {
|
||||||
/* We should get the transaction id from the server during initialization here */
|
/* We should get the transaction id from the server during initialization here */
|
||||||
load: function(trans_id, debug_type, function_name_with_arguments, layout) {
|
load: function(trans_id, debug_type, function_name_with_arguments, layout) {
|
||||||
|
@ -1537,19 +1543,7 @@ define([
|
||||||
controller.poll_result(trans_id);
|
controller.poll_result(trans_id);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function(xhr) {
|
.fail(raiseJSONError);
|
||||||
try {
|
|
||||||
var err = JSON.parse(xhr.responseText);
|
|
||||||
if (err.success == 0) {
|
|
||||||
Notify.alert(gettext('Debugger Error'), err.errormsg);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Error while starting debugging listener.')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else if (trans_id != undefined) {
|
} else if (trans_id != undefined) {
|
||||||
// Make ajax call to execute the and start the target for execution
|
// Make ajax call to execute the and start the target for execution
|
||||||
baseUrl = url_for('debugger.start_listener', {
|
baseUrl = url_for('debugger.start_listener', {
|
||||||
|
@ -1565,19 +1559,7 @@ define([
|
||||||
self.messages(trans_id);
|
self.messages(trans_id);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.fail(function(xhr) {
|
.fail(raiseJSONError);
|
||||||
try {
|
|
||||||
var err = JSON.parse(xhr.responseText);
|
|
||||||
if (err.success == 0) {
|
|
||||||
Notify.alert(gettext('Debugger Error'), err.errormsg);
|
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
Notify.alert(
|
|
||||||
gettext('Debugger Error'),
|
|
||||||
gettext('Error while starting debugging listener.')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
this.intializePanels();
|
this.intializePanels();
|
||||||
}
|
}
|
||||||
|
|
|
@ -543,6 +543,12 @@ define([
|
||||||
|
|
||||||
|
|
||||||
deleteUserCell = Backgrid.Extension.DeleteCell.extend({
|
deleteUserCell = Backgrid.Extension.DeleteCell.extend({
|
||||||
|
raiseError: function() {
|
||||||
|
Notify.error(
|
||||||
|
gettext('Error during deleting user.')
|
||||||
|
);
|
||||||
|
},
|
||||||
|
|
||||||
changeOwnership: function(res, uid) {
|
changeOwnership: function(res, uid) {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
||||||
|
@ -695,11 +701,7 @@ define([
|
||||||
alertify.changeOwnershipDialog().destroy();
|
alertify.changeOwnershipDialog().destroy();
|
||||||
alertify.UserManagement().destroy();
|
alertify.UserManagement().destroy();
|
||||||
},
|
},
|
||||||
error: function() {
|
error: self.raiseError,
|
||||||
Notify.error(
|
|
||||||
gettext('Error during deleting user.')
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
alertify.changeOwnershipDialog().destroy();
|
alertify.changeOwnershipDialog().destroy();
|
||||||
},
|
},
|
||||||
|
@ -745,11 +747,7 @@ define([
|
||||||
success: function() {
|
success: function() {
|
||||||
Notify.success(gettext('User deleted.'));
|
Notify.success(gettext('User deleted.'));
|
||||||
},
|
},
|
||||||
error: function() {
|
error: self.raiseError,
|
||||||
Notify.error(
|
|
||||||
gettext('Error during deleting user.')
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
|
|
|
@ -158,12 +158,16 @@ describe('SchemaView', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('DataGridView', ()=>{
|
describe('DataGridView', ()=>{
|
||||||
it('add row', (done)=>{
|
let ctrlUpdate = (done)=> {
|
||||||
ctrl.find('DataGridView').find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
|
||||||
setTimeout(()=>{
|
|
||||||
ctrl.update();
|
ctrl.update();
|
||||||
expect(ctrl.find('DataGridView').find('DataTableRow').length).toBe(1);
|
expect(ctrl.find('DataGridView').find('DataTableRow').length).toBe(1);
|
||||||
done();
|
done();
|
||||||
|
};
|
||||||
|
|
||||||
|
it('add row', (done)=>{
|
||||||
|
ctrl.find('DataGridView').find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
|
setTimeout(()=>{
|
||||||
|
ctrlUpdate(done);
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -184,9 +188,7 @@ describe('SchemaView', ()=>{
|
||||||
});
|
});
|
||||||
ctrl.find('DataGridView').find('PgIconButton[data-test="delete-row"]').at(0).find('button').simulate('click');
|
ctrl.find('DataGridView').find('PgIconButton[data-test="delete-row"]').at(0).find('button').simulate('click');
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
ctrl.update();
|
ctrlUpdate(done);
|
||||||
expect(ctrl.find('DataGridView').find('DataTableRow').length).toBe(1);
|
|
||||||
done();
|
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -263,6 +265,14 @@ describe('SchemaView', ()=>{
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let onRestAction = (done)=> {
|
||||||
|
ctrl.update();
|
||||||
|
expect(ctrl.find('DefaultButton[data-test="Reset"]').prop('disabled')).toBeTrue();
|
||||||
|
expect(ctrl.find('PrimaryButton[data-test="Save"]').prop('disabled')).toBeTrue();
|
||||||
|
expect(onDataChange).toHaveBeenCalledWith(false, {});
|
||||||
|
done();
|
||||||
|
};
|
||||||
|
|
||||||
describe('onReset', ()=>{
|
describe('onReset', ()=>{
|
||||||
it('with confirm check and yes click', (done)=>{
|
it('with confirm check and yes click', (done)=>{
|
||||||
simulateValidData();
|
simulateValidData();
|
||||||
|
@ -272,11 +282,7 @@ describe('SchemaView', ()=>{
|
||||||
/* Press OK */
|
/* Press OK */
|
||||||
confirmSpy.calls.argsFor(0)[2]();
|
confirmSpy.calls.argsFor(0)[2]();
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
ctrl.update();
|
onRestAction(done);
|
||||||
expect(ctrl.find('DefaultButton[data-test="Reset"]').prop('disabled')).toBeTrue();
|
|
||||||
expect(ctrl.find('PrimaryButton[data-test="Save"]').prop('disabled')).toBeTrue();
|
|
||||||
expect(onDataChange).toHaveBeenCalledWith(false, {});
|
|
||||||
done();
|
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -418,11 +424,7 @@ describe('SchemaView', ()=>{
|
||||||
/* Press OK */
|
/* Press OK */
|
||||||
confirmSpy.calls.argsFor(0)[2]();
|
confirmSpy.calls.argsFor(0)[2]();
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
ctrl.update();
|
onRestAction(done);
|
||||||
expect(ctrl.find('DefaultButton[data-test="Reset"]').prop('disabled')).toBeTrue();
|
|
||||||
expect(ctrl.find('PrimaryButton[data-test="Save"]').prop('disabled')).toBeTrue();
|
|
||||||
expect(onDataChange).toHaveBeenCalledWith(false, {});
|
|
||||||
done();
|
|
||||||
}, 0);
|
}, 0);
|
||||||
}, 0);
|
}, 0);
|
||||||
});
|
});
|
||||||
|
|
|
@ -51,6 +51,16 @@ describe('FormComponents', ()=>{
|
||||||
jasmineEnzyme();
|
jasmineEnzyme();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let onAccessibility = (ctrl)=> {
|
||||||
|
expect(ctrl.find(InputLabel)).toHaveProp('htmlFor', 'inpCid');
|
||||||
|
expect(ctrl.find(FormHelperText)).toHaveProp('id', 'hinpCid');
|
||||||
|
let inputProps = ctrl.find(OutlinedInput).prop('inputProps');
|
||||||
|
expect(inputProps).toEqual(jasmine.objectContaining({
|
||||||
|
id: 'inpCid',
|
||||||
|
'aria-describedby': 'hinpCid',
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
describe('FormInputText', ()=>{
|
describe('FormInputText', ()=>{
|
||||||
let ThemedFormInputText = withTheme(FormInputText), ctrl;
|
let ThemedFormInputText = withTheme(FormInputText), ctrl;
|
||||||
|
|
||||||
|
@ -99,13 +109,7 @@ describe('FormComponents', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accessibility', ()=>{
|
it('accessibility', ()=>{
|
||||||
expect(ctrl.find(InputLabel)).toHaveProp('htmlFor', 'inpCid');
|
onAccessibility(ctrl);
|
||||||
expect(ctrl.find(FormHelperText)).toHaveProp('id', 'hinpCid');
|
|
||||||
let inputProps = ctrl.find(OutlinedInput).prop('inputProps');
|
|
||||||
expect(inputProps).toEqual(jasmine.objectContaining({
|
|
||||||
id: 'inpCid',
|
|
||||||
'aria-describedby': 'hinpCid',
|
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -167,13 +171,7 @@ describe('FormComponents', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accessibility', ()=>{
|
it('accessibility', ()=>{
|
||||||
expect(ctrl.find(InputLabel)).toHaveProp('htmlFor', 'inpCid');
|
onAccessibility(ctrl);
|
||||||
expect(ctrl.find(FormHelperText)).toHaveProp('id', 'hinpCid');
|
|
||||||
let inputProps = ctrl.find(OutlinedInput).prop('inputProps');
|
|
||||||
expect(inputProps).toEqual(jasmine.objectContaining({
|
|
||||||
id: 'inpCid',
|
|
||||||
'aria-describedby': 'hinpCid',
|
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,23 @@ import { withTheme } from '../fake_theme';
|
||||||
|
|
||||||
describe('Privilege', ()=>{
|
describe('Privilege', ()=>{
|
||||||
let ctrl, onChange = jasmine.createSpy('onChange');
|
let ctrl, onChange = jasmine.createSpy('onChange');
|
||||||
|
let onClickAction = (done)=> {
|
||||||
|
expect(onChange).toHaveBeenCalledWith([{
|
||||||
|
privilege_type: 'C',
|
||||||
|
privilege: true,
|
||||||
|
with_grant: false,
|
||||||
|
},{
|
||||||
|
privilege_type: 'a',
|
||||||
|
privilege: true,
|
||||||
|
with_grant: true,
|
||||||
|
},{
|
||||||
|
privilege_type: 'r',
|
||||||
|
privilege: true,
|
||||||
|
with_grant: false,
|
||||||
|
}]);
|
||||||
|
done();
|
||||||
|
};
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
jasmineEnzyme();
|
||||||
let ThemedPrivilege = withTheme(Privilege);
|
let ThemedPrivilege = withTheme(Privilege);
|
||||||
|
@ -111,20 +128,7 @@ describe('Privilege', ()=>{
|
||||||
simulate('change', {target: {checked: true, name: 'r'}});
|
simulate('change', {target: {checked: true, name: 'r'}});
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
expect(onChange).toHaveBeenCalledWith([{
|
onClickAction(done);
|
||||||
privilege_type: 'C',
|
|
||||||
privilege: true,
|
|
||||||
with_grant: false,
|
|
||||||
},{
|
|
||||||
privilege_type: 'a',
|
|
||||||
privilege: true,
|
|
||||||
with_grant: true,
|
|
||||||
},{
|
|
||||||
privilege_type: 'r',
|
|
||||||
privilege: true,
|
|
||||||
with_grant: false,
|
|
||||||
}]);
|
|
||||||
done();
|
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -151,20 +155,7 @@ describe('Privilege', ()=>{
|
||||||
ctrl.find('InputCheckbox[name="all"]').at(0).find('input').simulate('change', {target: {checked: true}});
|
ctrl.find('InputCheckbox[name="all"]').at(0).find('input').simulate('change', {target: {checked: true}});
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
expect(onChange).toHaveBeenCalledWith([{
|
onClickAction(done);
|
||||||
privilege_type: 'C',
|
|
||||||
privilege: true,
|
|
||||||
with_grant: false,
|
|
||||||
},{
|
|
||||||
privilege_type: 'a',
|
|
||||||
privilege: true,
|
|
||||||
with_grant: true,
|
|
||||||
},{
|
|
||||||
privilege_type: 'r',
|
|
||||||
privilege: true,
|
|
||||||
with_grant: false,
|
|
||||||
}]);
|
|
||||||
done();
|
|
||||||
}, 500);
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,74 @@
|
||||||
|
/////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// pgAdmin 4 - PostgreSQL Tools
|
||||||
|
//
|
||||||
|
// Copyright (C) 2013 - 2022, The pgAdmin Development Team
|
||||||
|
// This software is released under the PostgreSQL Licence
|
||||||
|
//
|
||||||
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
import jasmineEnzyme from 'jasmine-enzyme';
|
||||||
|
import React from 'react';
|
||||||
|
import pgAdmin from 'sources/pgadmin';
|
||||||
|
import {messages} from './fake_messages';
|
||||||
|
import SchemaView from '../../pgadmin/static/js/SchemaView';
|
||||||
|
|
||||||
|
export let getEditView = (schemaObj, getInitData)=> {
|
||||||
|
return <SchemaView
|
||||||
|
formType='dialog'
|
||||||
|
schema={schemaObj}
|
||||||
|
getInitData={getInitData}
|
||||||
|
viewHelperProps={{
|
||||||
|
mode: 'edit',
|
||||||
|
}}
|
||||||
|
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
confirmOnCloseReset={false}
|
||||||
|
hasSQL={false}
|
||||||
|
disableSqlHelp={false}
|
||||||
|
disableDialogHelp={false}
|
||||||
|
/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export let getCreateView = (schemaObj)=> {
|
||||||
|
return <SchemaView
|
||||||
|
formType='dialog'
|
||||||
|
schema={schemaObj}
|
||||||
|
viewHelperProps={{
|
||||||
|
mode: 'create',
|
||||||
|
}}
|
||||||
|
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
confirmOnCloseReset={false}
|
||||||
|
hasSQL={false}
|
||||||
|
disableSqlHelp={false}
|
||||||
|
disableDialogHelp={false}
|
||||||
|
/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export let getPropertiesView = (schemaObj, getInitData)=> {
|
||||||
|
return <SchemaView
|
||||||
|
formType='tab'
|
||||||
|
schema={schemaObj}
|
||||||
|
getInitData={getInitData}
|
||||||
|
viewHelperProps={{
|
||||||
|
mode: 'properties',
|
||||||
|
}}
|
||||||
|
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
||||||
|
/>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export let genericBeforeEach = ()=> {
|
||||||
|
jasmineEnzyme();
|
||||||
|
/* messages used by validators */
|
||||||
|
pgAdmin.Browser = pgAdmin.Browser || {};
|
||||||
|
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
||||||
|
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
||||||
|
};
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import AggregateSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/aggregates/static/js/aggregate.ui';
|
import AggregateSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/aggregates/static/js/aggregate.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('AggregateSchema', ()=>{
|
describe('AggregateSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -33,63 +28,19 @@ describe('AggregateSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import CastSchema from '../../../pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.ui';
|
import CastSchema from '../../../pgadmin/browser/server_groups/servers/databases/casts/static/js/cast.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
|
|
||||||
describe('CastSchema', ()=>{
|
describe('CastSchema', ()=>{
|
||||||
|
@ -38,63 +34,19 @@ describe('CastSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('srctyp depChange', ()=>{
|
it('srctyp depChange', ()=>{
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import CatalogSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.ui';
|
import CatalogSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/static/js/catalog.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('CatalogSchema', ()=>{
|
describe('CatalogSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -37,63 +32,19 @@ describe('CatalogSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(catalogObj));
|
||||||
formType='dialog'
|
|
||||||
schema={catalogObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={true}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(catalogObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={catalogObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={true}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(catalogObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={catalogObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import CatalogObjectSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/static/js/catalog_object.ui';
|
import CatalogObjectSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/static/js/catalog_object.ui';
|
||||||
|
import {genericBeforeEach, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('CatalogObjectSchema', ()=>{
|
describe('CatalogObjectSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -32,23 +28,10 @@ describe('CatalogObjectSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import CatalogObjectColumn from '../../../pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/static/js/catalog_object_column.ui';
|
import CatalogObjectColumn from '../../../pgadmin/browser/server_groups/servers/databases/schemas/catalog_objects/columns/static/js/catalog_object_column.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('CatalogObjectColumn', ()=>{
|
describe('CatalogObjectColumn', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -32,42 +28,15 @@ describe('CatalogObjectColumn', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,16 +7,13 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import CheckConstraintSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.ui';
|
import CheckConstraintSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/check_constraint/static/js/check_constraint.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class SchemaInColl extends BaseUISchema {
|
class SchemaInColl extends BaseUISchema {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
@ -53,83 +50,24 @@ describe('CheckConstraintSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new SchemaInColl();
|
let schemaCollObj = new SchemaInColl();
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import { messages } from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import CollationSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.ui';
|
import CollationSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/collations/static/js/collation.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('CollationsSchema', () => {
|
describe('CollationsSchema', () => {
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -43,63 +38,19 @@ describe('CollationsSchema', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', () => {
|
it('create', () => {
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', () => {
|
it('edit', () => {
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', () => {
|
it('properties', () => {
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={() => {/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', () => {
|
it('validate', () => {
|
||||||
|
|
|
@ -7,16 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import ColumnSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui';
|
import ColumnSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/columns/static/js/column.ui';
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -74,83 +70,24 @@ describe('ColumnSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new ColumnInColl();
|
let schemaCollObj = new ColumnInColl();
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import CompoundTriggerSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/static/js/compound_trigger.ui';
|
import CompoundTriggerSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/compound_triggers/static/js/compound_trigger.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('CompoundTriggerSchema', ()=>{
|
describe('CompoundTriggerSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -41,61 +37,19 @@ describe('CompoundTriggerSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,16 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import DatabaseSchema from '../../../pgadmin/browser/server_groups/servers/databases/static/js/database.ui';
|
import DatabaseSchema from '../../../pgadmin/browser/server_groups/servers/databases/static/js/database.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -54,64 +50,19 @@ describe('DatabaseSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('schema_res depChange', ()=>{
|
it('schema_res depChange', ()=>{
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import DomainSchema, { DomainConstSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.ui';
|
import DomainSchema, { DomainConstSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/domains/static/js/domain.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('DomainSchema', ()=>{
|
describe('DomainSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -46,63 +42,19 @@ describe('DomainSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -141,66 +93,22 @@ describe('DomainConstSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import DomainConstraintSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.ui';
|
import DomainConstraintSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/domains/domain_constraints/static/js/domain_constraints.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('DomainConstraintSchema', ()=>{
|
describe('DomainConstraintSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -32,63 +28,19 @@ describe('DomainConstraintSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import EDBFuncSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbfunc.ui';
|
import EDBFuncSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/packages/edbfuncs/static/js/edbfunc.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('EDBFuncSchema', ()=>{
|
describe('EDBFuncSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -37,63 +32,19 @@ describe('EDBFuncSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(edbFuncSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={edbFuncSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(edbFuncSchemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={edbFuncSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(edbFuncSchemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={edbFuncSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import EDBVarSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/packages/edbvars/static/js/edbvar.ui';
|
import EDBVarSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/packages/edbvars/static/js/edbvar.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('EDBVarSchema', ()=>{
|
describe('EDBVarSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -33,63 +28,19 @@ describe('EDBVarSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(edbVarSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={edbVarSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(edbVarSchemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={edbVarSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(edbVarSchemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={edbVarSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import EventTriggerSchema from '../../../pgadmin/browser/server_groups/servers/databases/event_triggers/static/js/event_trigger.ui';
|
import EventTriggerSchema from '../../../pgadmin/browser/server_groups/servers/databases/event_triggers/static/js/event_trigger.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('EventTriggerSchema', ()=>{
|
describe('EventTriggerSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -41,63 +36,19 @@ describe('EventTriggerSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,19 +7,16 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { getNodeExclusionConstraintSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui';
|
import { getNodeExclusionConstraintSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/exclusion_constraint/static/js/exclusion_constraint.ui';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
||||||
import Notify from '../../../pgadmin/static/js/helpers/Notifier';
|
import Notify from '../../../pgadmin/static/js/helpers/Notifier';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class SchemaInColl extends BaseUISchema {
|
class SchemaInColl extends BaseUISchema {
|
||||||
constructor(schemaObj) {
|
constructor(schemaObj) {
|
||||||
|
@ -61,83 +58,24 @@ describe('ExclusionConstraintSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new SchemaInColl(schemaObj);
|
let schemaCollObj = new SchemaInColl(schemaObj);
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import ExtensionsSchema from '../../../pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.ui';
|
import ExtensionsSchema from '../../../pgadmin/browser/server_groups/servers/databases/extensions/static/js/extension.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('ExtensionSchema', ()=>{
|
describe('ExtensionSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -38,63 +33,19 @@ describe('ExtensionSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import ForeignDataWrapperSchema from '../../../pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.ui';
|
import ForeignDataWrapperSchema from '../../../pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/static/js/foreign_data_wrapper.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -49,63 +45,19 @@ describe('ForeignDataWrapperSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,18 +7,15 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import { getNodeForeignKeySchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui';
|
import { getNodeForeignKeySchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.ui';
|
||||||
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class SchemaInColl extends BaseUISchema {
|
class SchemaInColl extends BaseUISchema {
|
||||||
constructor(schemaObj) {
|
constructor(schemaObj) {
|
||||||
|
@ -60,83 +57,24 @@ describe('ForeignKeySchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new SchemaInColl(schemaObj);
|
let schemaCollObj = new SchemaInColl(schemaObj);
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import ForeignServerSchema from '../../../pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.ui';
|
import ForeignServerSchema from '../../../pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/static/js/foreign_server.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -47,63 +43,19 @@ describe('ForeignServerSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,13 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import ForeignTableSchema, { ColumnSchema, CheckConstraintSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui';
|
import ForeignTableSchema, { ColumnSchema, CheckConstraintSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/static/js/foreign_table.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -56,61 +54,19 @@ describe('ForeignTableSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
@ -167,6 +123,14 @@ describe('ForeignTableSchema', ()=>{
|
||||||
describe('inherits change', ()=>{
|
describe('inherits change', ()=>{
|
||||||
let deferredDepChange;
|
let deferredDepChange;
|
||||||
let inheritCol = {name: 'id'};
|
let inheritCol = {name: 'id'};
|
||||||
|
let addInheritCols = (depChange, state, done)=> {
|
||||||
|
let finalCols = [{name: 'desc'}];
|
||||||
|
expect(depChange(state)).toEqual({
|
||||||
|
adding_inherit_cols: false,
|
||||||
|
columns: finalCols,
|
||||||
|
});
|
||||||
|
done();
|
||||||
|
};
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
spyOn(schemaObj, 'getTableOid').and.returnValue(123456);
|
spyOn(schemaObj, 'getTableOid').and.returnValue(123456);
|
||||||
|
@ -201,12 +165,7 @@ describe('ForeignTableSchema', ()=>{
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
deferredPromise.then((depChange)=>{
|
deferredPromise.then((depChange)=>{
|
||||||
let finalCols = [{name: 'desc'}];
|
addInheritCols(depChange, state, done);
|
||||||
expect(depChange(state)).toEqual({
|
|
||||||
adding_inherit_cols: false,
|
|
||||||
columns: finalCols,
|
|
||||||
});
|
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -219,12 +178,7 @@ describe('ForeignTableSchema', ()=>{
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
deferredPromise.then((depChange)=>{
|
deferredPromise.then((depChange)=>{
|
||||||
let finalCols = [{name: 'desc'}];
|
addInheritCols(depChange, state, done);
|
||||||
expect(depChange(state)).toEqual({
|
|
||||||
adding_inherit_cols: false,
|
|
||||||
columns: finalCols,
|
|
||||||
});
|
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -258,61 +212,19 @@ describe('ForeignTableColumnSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('column editable', ()=>{
|
it('column editable', ()=>{
|
||||||
|
@ -436,61 +348,19 @@ describe('ForeignTableCheckConstraint', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('conname editable', ()=>{
|
it('conname editable', ()=>{
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import FTSConfigurationSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.ui';
|
import FTSConfigurationSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_configurations/static/js/fts_configuration.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('FTSConfigurationSchema', ()=>{
|
describe('FTSConfigurationSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -45,63 +41,19 @@ describe('FTSConfigurationSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import FTSDictionarySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/static/js/fts_dictionary.ui';
|
import FTSDictionarySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_dictionaries/static/js/fts_dictionary.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('FTSDictionarySchema', ()=>{
|
describe('FTSDictionarySchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -43,63 +39,19 @@ describe('FTSDictionarySchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import FTSParserSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/static/js/fts_parser.ui';
|
import FTSParserSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_parsers/static/js/fts_parser.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('FTSParserSchema', ()=>{
|
describe('FTSParserSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -45,63 +40,19 @@ describe('FTSParserSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import FTSTemplateSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/static/js/fts_template.ui';
|
import FTSTemplateSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/fts_templates/static/js/fts_template.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('FTSTemplateSchema', ()=>{
|
describe('FTSTemplateSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -42,63 +37,19 @@ describe('FTSTemplateSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import FunctionSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.ui';
|
import FunctionSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/function.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -124,79 +120,23 @@ describe('FunctionSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(procedureSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={procedureSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('proiswindow visible', ()=>{
|
it('proiswindow visible', ()=>{
|
||||||
|
@ -247,22 +187,7 @@ describe('FunctionSchema', ()=>{
|
||||||
type: 'function',
|
type: 'function',
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -314,22 +239,7 @@ describe('FunctionSchema', ()=>{
|
||||||
type: 'function',
|
type: 'function',
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -380,22 +290,7 @@ describe('FunctionSchema', ()=>{
|
||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('proiswindow visible', ()=>{
|
it('proiswindow visible', ()=>{
|
||||||
|
@ -445,22 +340,7 @@ describe('FunctionSchema', ()=>{
|
||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -514,22 +394,7 @@ describe('FunctionSchema', ()=>{
|
||||||
type: 'procedure',
|
type: 'procedure',
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,13 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import { messages } from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import GrantWizardPrivilegeSchema from '../../../pgadmin/tools/grant_wizard/static/js/privilege_schema.ui';
|
import GrantWizardPrivilegeSchema from '../../../pgadmin/tools/grant_wizard/static/js/privilege_schema.ui';
|
||||||
|
import {genericBeforeEach} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -41,11 +38,7 @@ describe('GrantWizard', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', () => {
|
it('create', () => {
|
||||||
|
|
|
@ -7,11 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
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';
|
import ImportExportSchema, {getFileInfoSchema, getMiscellaneousSchema} from '../../../pgadmin/tools/import_export/static/js/import_export.ui';
|
||||||
|
import {getCreateView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('ImportExportSchema', ()=>{
|
describe('ImportExportSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -30,21 +29,7 @@ describe('ImportExportSchema', ()=>{
|
||||||
);
|
);
|
||||||
|
|
||||||
it('start import export', ()=>{
|
it('start import export', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(importExportSchemaObj));
|
||||||
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}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,14 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import { messages } from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
||||||
import ImportExportSelectionSchema from '../../../pgadmin/tools/import_export_servers/static/js/import_export_selection.ui';
|
import ImportExportSelectionSchema from '../../../pgadmin/tools/import_export_servers/static/js/import_export_selection.ui';
|
||||||
|
import {genericBeforeEach} from '../genericFunctions';
|
||||||
|
|
||||||
describe('ImportExportServers', () => {
|
describe('ImportExportServers', () => {
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -31,11 +29,7 @@ describe('ImportExportServers', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('import', () => {
|
it('import', () => {
|
||||||
|
|
|
@ -7,16 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import IndexSchema, { getColumnSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui';
|
import IndexSchema, { getColumnSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/indexes/static/js/index.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('IndexSchema', ()=>{
|
describe('IndexSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -30,40 +25,9 @@ describe('IndexSchema', ()=>{
|
||||||
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue([]);
|
||||||
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getCreateView(columnSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={columnSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(columnSchemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={columnSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('column schema colname editable', ()=>{
|
it('column schema colname editable', ()=>{
|
||||||
|
@ -168,63 +132,19 @@ describe('IndexSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(indexSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={indexSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(indexSchemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={indexSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(indexSchemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={indexSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import LanguageSchema from '../../../pgadmin/browser/server_groups/servers/databases/languages/static/js/language.ui';
|
import LanguageSchema from '../../../pgadmin/browser/server_groups/servers/databases/languages/static/js/language.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -53,63 +49,19 @@ describe('LanguageSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,12 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import MaintenanceSchema, {getVacuumSchema} from '../../../pgadmin/tools/maintenance/static/js/maintenance.ui';
|
import MaintenanceSchema, {getVacuumSchema} from '../../../pgadmin/tools/maintenance/static/js/maintenance.ui';
|
||||||
|
import {getCreateView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('MaintenanceSchema', ()=>{
|
describe('MaintenanceSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -31,21 +29,7 @@ describe('MaintenanceSchema', ()=>{
|
||||||
);
|
);
|
||||||
|
|
||||||
it('start maintenance', ()=>{
|
it('start maintenance', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(backupSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={backupSchemaObj}
|
|
||||||
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}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,16 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import MembershipSchema from '../../../pgadmin/browser/server_groups/servers/static/js/membership.ui';
|
import MembershipSchema from '../../../pgadmin/browser/server_groups/servers/static/js/membership.ui';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class SchemaInColl extends BaseUISchema {
|
class SchemaInColl extends BaseUISchema {
|
||||||
constructor(schemaObj) {
|
constructor(schemaObj) {
|
||||||
|
@ -51,84 +47,24 @@ describe('MembershipSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('MembershipMemberSchema', ()=>{
|
it('MembershipMemberSchema', ()=>{
|
||||||
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(new SchemaInColl(schemaObj)));
|
||||||
formType='dialog'
|
|
||||||
schema={new SchemaInColl(schemaObj)}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,16 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import MViewSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.ui';
|
import MViewSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/mview.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -52,63 +47,19 @@ describe('MaterializedViewSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import OperatorSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/operators/static/js/operator.ui';
|
import OperatorSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/operators/static/js/operator.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('OperatorSchema', ()=>{
|
describe('OperatorSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -33,63 +28,19 @@ describe('OperatorSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import { getNodePrivilegeRoleSchema } from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
import { getNodePrivilegeRoleSchema } from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
||||||
import PackageSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.ui';
|
import PackageSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/packages/static/js/package.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('PackageSchema', ()=>{
|
describe('PackageSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -40,63 +35,19 @@ describe('PackageSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(packageSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={packageSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(packageSchemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={packageSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(packageSchemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={packageSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('pkgheadsrc depChange', ()=>{
|
it('pkgheadsrc depChange', ()=>{
|
||||||
|
|
|
@ -7,16 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import { getNodePartitionTableSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.ui';
|
import { getNodePartitionTableSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/partitions/static/js/partition.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('PartitionTableSchema', ()=>{
|
describe('PartitionTableSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -53,63 +49,19 @@ describe('PartitionTableSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('depChange', ()=>{
|
it('depChange', ()=>{
|
||||||
|
|
|
@ -7,17 +7,13 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import { PartitionKeysSchema, PartitionsSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.ui';
|
import { PartitionKeysSchema, PartitionsSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/partition.utils.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
function getFieldDepChange(schema, id) {
|
function getFieldDepChange(schema, id) {
|
||||||
return _.find(schema.fields, (f)=>f.id==id)?.depChange;
|
return _.find(schema.fields, (f)=>f.id==id)?.depChange;
|
||||||
|
@ -63,30 +59,11 @@ describe('PartitionKeysSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
|
@ -94,36 +71,11 @@ describe('PartitionKeysSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('depChange', ()=>{
|
it('depChange', ()=>{
|
||||||
|
@ -174,85 +126,26 @@ describe('PartitionsSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new SchemaInColl(
|
let schemaCollObj = new SchemaInColl(
|
||||||
schemaObj,[ 'is_attach', 'partition_name', 'is_default', 'values_from', 'values_to', 'values_in', 'values_modulus', 'values_remainder']
|
schemaObj,[ 'is_attach', 'partition_name', 'is_default', 'values_from', 'values_to', 'values_in', 'values_modulus', 'values_remainder']
|
||||||
);
|
);
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import PgaJobSchema from '../../../pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.ui';
|
import PgaJobSchema from '../../../pgadmin/browser/server_groups/servers/pgagent/static/js/pga_job.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -44,61 +40,19 @@ describe('PgaJobSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import PgaJobStepSchema from '../../../pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui';
|
import PgaJobStepSchema from '../../../pgadmin/browser/server_groups/servers/pgagent/steps/static/js/pga_jobstep.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('PgaJobStepSchema', ()=>{
|
describe('PgaJobStepSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -40,61 +36,19 @@ describe('PgaJobStepSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import PgaJobScheduleSchema, { ExceptionsSchema } from '../../../pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.ui';
|
import PgaJobScheduleSchema, { ExceptionsSchema } from '../../../pgadmin/browser/server_groups/servers/pgagent/schedules/static/js/pga_schedule.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('PgaJobScheduleSchema', ()=>{
|
describe('PgaJobScheduleSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -35,61 +31,19 @@ describe('PgaJobScheduleSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
@ -130,61 +84,19 @@ describe('ExceptionsSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,17 +7,14 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import PrimaryKeySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui';
|
import PrimaryKeySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/primary_key.ui';
|
||||||
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class SchemaInColl extends BaseUISchema {
|
class SchemaInColl extends BaseUISchema {
|
||||||
constructor(schemaObj) {
|
constructor(schemaObj) {
|
||||||
|
@ -59,83 +56,24 @@ describe('PrimaryKeySchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new SchemaInColl(schemaObj);
|
let schemaCollObj = new SchemaInColl(schemaObj);
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,16 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import PrivilegeRoleSchema, {getNodePrivilegeRoleSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
import PrivilegeRoleSchema, {getNodePrivilegeRoleSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
||||||
import {DefaultPrivSchema} from '../../../pgadmin/browser/server_groups/servers/databases/static/js/database.ui';
|
import {DefaultPrivSchema} from '../../../pgadmin/browser/server_groups/servers/databases/static/js/database.ui';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('PrivilegeSchema', ()=>{
|
describe('PrivilegeSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -40,64 +36,19 @@ describe('PrivilegeSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
@ -111,22 +62,7 @@ describe('PrivilegeSchema', ()=>{
|
||||||
it('DefaultPrivSchema', ()=>{
|
it('DefaultPrivSchema', ()=>{
|
||||||
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
||||||
let defPrivObj = new DefaultPrivSchema((privileges)=>getNodePrivilegeRoleSchema({}, {server: {user: {name: 'postgres'}}}, {}, privileges));
|
let defPrivObj = new DefaultPrivSchema((privileges)=>getNodePrivilegeRoleSchema({}, {server: {user: {name: 'postgres'}}}, {}, privileges));
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(defPrivObj));
|
||||||
formType='dialog'
|
|
||||||
schema={defPrivObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,16 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import PublicationSchema from '../../../pgadmin/browser/server_groups/servers/databases/publications/static/js/publication.ui';
|
import PublicationSchema from '../../../pgadmin/browser/server_groups/servers/databases/publications/static/js/publication.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
|
|
||||||
describe('PublicationSchema', ()=>{
|
describe('PublicationSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -48,63 +42,19 @@ describe('PublicationSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('pubtable disabled', ()=>{
|
it('pubtable disabled', ()=>{
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import ResourceGroupSchema from '../../../pgadmin/browser/server_groups/servers/resource_groups/static/js/resource_group.ui';
|
import ResourceGroupSchema from '../../../pgadmin/browser/server_groups/servers/resource_groups/static/js/resource_group.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('ResourceGroupSchema', ()=>{
|
describe('ResourceGroupSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -32,63 +28,19 @@ describe('ResourceGroupSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,12 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import pgAdmin from 'sources/pgadmin';
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import RestoreSchema, {getRestoreSaveOptSchema, getRestoreQueryOptionSchema, getRestoreDisableOptionSchema, getRestoreMiscellaneousSchema, getRestoreTypeObjSchema, getRestoreSectionSchema} from '../../../pgadmin/tools/restore/static/js/restore.ui';
|
import RestoreSchema, {getRestoreSaveOptSchema, getRestoreQueryOptionSchema, getRestoreDisableOptionSchema, getRestoreMiscellaneousSchema, getRestoreTypeObjSchema, getRestoreSectionSchema} from '../../../pgadmin/tools/restore/static/js/restore.ui';
|
||||||
|
import {getCreateView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('RestoreSchema', ()=>{
|
describe('RestoreSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -39,21 +38,7 @@ describe('RestoreSchema', ()=>{
|
||||||
);
|
);
|
||||||
|
|
||||||
it('restore dialog', ()=>{
|
it('restore dialog', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(restoreSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={restoreSchemaObj}
|
|
||||||
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}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('restore validate', () => {
|
it('restore validate', () => {
|
||||||
|
|
|
@ -7,16 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import RoleSchema from '../../../pgadmin/browser/server_groups/servers/roles/static/js/role.ui';
|
import RoleSchema from '../../../pgadmin/browser/server_groups/servers/roles/static/js/role.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -47,61 +42,19 @@ describe('RoleSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import RowSecurityPolicySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui';
|
import RowSecurityPolicySchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/row_security_policies/static/js/row_security_policy.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('RowSecurityPolicySchema', ()=>{
|
describe('RowSecurityPolicySchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -38,61 +33,19 @@ describe('RowSecurityPolicySchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import RuleSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.ui';
|
import RuleSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/rules/static/js/rule.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('RuleSchema', ()=>{
|
describe('RuleSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -38,61 +33,19 @@ describe('RuleSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,16 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import {getNodePrivilegeRoleSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
import {getNodePrivilegeRoleSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
||||||
import PGSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/static/js/schema.ui';
|
import PGSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/static/js/schema.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('PGSchema', ()=>{
|
describe('PGSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -40,30 +35,11 @@ describe('PGSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('schema validate', () => {
|
it('schema validate', () => {
|
||||||
|
@ -79,36 +55,11 @@ describe('PGSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import SequenceSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui';
|
import SequenceSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/sequences/static/js/sequence.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -48,63 +44,19 @@ describe('SequenceSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,14 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import pgAdmin from 'sources/pgadmin';
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import ServerSchema from '../../../pgadmin/browser/server_groups/servers/static/js/server.ui';
|
import ServerSchema from '../../../pgadmin/browser/server_groups/servers/static/js/server.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('ServerSchema', ()=>{
|
describe('ServerSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -36,64 +33,20 @@ describe('ServerSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import ServerGroupSchema from '../../../pgadmin/browser/server_groups/static/js/server_group.ui';
|
import ServerGroupSchema from '../../../pgadmin/browser/server_groups/static/js/server_group.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('ServerGroupSchema', ()=>{
|
describe('ServerGroupSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -32,61 +28,18 @@ describe('ServerGroupSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import SubscriptionSchema from '../../../pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui';
|
import SubscriptionSchema from '../../../pgadmin/browser/server_groups/servers/databases/subscriptions/static/js/subscription.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('SubscriptionSchema', ()=>{
|
describe('SubscriptionSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -50,61 +46,19 @@ describe('SubscriptionSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import SynonymSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.ui';
|
import SynonymSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/synonyms/static/js/synonym.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('SynonymSchema', ()=>{
|
describe('SynonymSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -45,63 +41,19 @@ describe('SynonymSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,17 +7,14 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { getNodeTableSchema, LikeSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
import { getNodeTableSchema, LikeSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import Notify from '../../../pgadmin/static/js/helpers/Notifier';
|
import Notify from '../../../pgadmin/static/js/helpers/Notifier';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
function getFieldDepChange(schema, id) {
|
function getFieldDepChange(schema, id) {
|
||||||
return _.find(schema.fields, (f)=>f.id==id)?.depChange;
|
return _.find(schema.fields, (f)=>f.id==id)?.depChange;
|
||||||
|
@ -58,63 +55,19 @@ describe('TableSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getTableOid', ()=>{
|
it('getTableOid', ()=>{
|
||||||
|
@ -161,14 +114,7 @@ describe('TableSchema', ()=>{
|
||||||
];
|
];
|
||||||
});
|
});
|
||||||
|
|
||||||
it('initial selection with OK', (done)=>{
|
let onDepChangeAction = (depChange, done)=> {
|
||||||
let state = {typname: 'type1'};
|
|
||||||
let deferredPromise = deferredDepChange(state, null, null, {
|
|
||||||
oldState: {
|
|
||||||
typname: null,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
deferredPromise.then((depChange)=>{
|
|
||||||
expect(depChange()).toEqual({
|
expect(depChange()).toEqual({
|
||||||
columns: oftypeColumns,
|
columns: oftypeColumns,
|
||||||
primary_key: [],
|
primary_key: [],
|
||||||
|
@ -180,6 +126,17 @@ describe('TableSchema', ()=>{
|
||||||
});
|
});
|
||||||
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(oftypeColumns);
|
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(oftypeColumns);
|
||||||
done();
|
done();
|
||||||
|
};
|
||||||
|
|
||||||
|
it('initial selection with OK', (done)=>{
|
||||||
|
let state = {typname: 'type1'};
|
||||||
|
let deferredPromise = deferredDepChange(state, null, null, {
|
||||||
|
oldState: {
|
||||||
|
typname: null,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
deferredPromise.then((depChange)=>{
|
||||||
|
onDepChangeAction(depChange, done);
|
||||||
});
|
});
|
||||||
/* Press OK */
|
/* Press OK */
|
||||||
confirmSpy.calls.argsFor(0)[2]();
|
confirmSpy.calls.argsFor(0)[2]();
|
||||||
|
@ -210,17 +167,7 @@ describe('TableSchema', ()=>{
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
deferredPromise.then((depChange)=>{
|
deferredPromise.then((depChange)=>{
|
||||||
expect(depChange()).toEqual({
|
onDepChangeAction(depChange, done);
|
||||||
columns: oftypeColumns,
|
|
||||||
primary_key: [],
|
|
||||||
foreign_key: [],
|
|
||||||
exclude_constraint: [],
|
|
||||||
unique_constraint: [],
|
|
||||||
partition_keys: [],
|
|
||||||
partitions: [],
|
|
||||||
});
|
|
||||||
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(oftypeColumns);
|
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -241,6 +188,15 @@ describe('TableSchema', ()=>{
|
||||||
describe('coll_inherits change', ()=>{
|
describe('coll_inherits change', ()=>{
|
||||||
let deferredDepChange;
|
let deferredDepChange;
|
||||||
let inheritCol = {name: 'id'};
|
let inheritCol = {name: 'id'};
|
||||||
|
let onRemoveAction = (depChange, state, done)=> {
|
||||||
|
let finalCols = [{name: 'desc'}];
|
||||||
|
expect(depChange(state)).toEqual({
|
||||||
|
adding_inherit_cols: false,
|
||||||
|
columns: finalCols,
|
||||||
|
});
|
||||||
|
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(finalCols);
|
||||||
|
done();
|
||||||
|
};
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
spyOn(schemaObj,'changeColumnOptions').and.callThrough();
|
spyOn(schemaObj,'changeColumnOptions').and.callThrough();
|
||||||
|
@ -297,13 +253,7 @@ describe('TableSchema', ()=>{
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
deferredPromise.then((depChange)=>{
|
deferredPromise.then((depChange)=>{
|
||||||
let finalCols = [{name: 'desc'}];
|
onRemoveAction(depChange, state, done);
|
||||||
expect(depChange(state)).toEqual({
|
|
||||||
adding_inherit_cols: false,
|
|
||||||
columns: finalCols,
|
|
||||||
});
|
|
||||||
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(finalCols);
|
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -317,13 +267,7 @@ describe('TableSchema', ()=>{
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
deferredPromise.then((depChange)=>{
|
deferredPromise.then((depChange)=>{
|
||||||
let finalCols = [{name: 'desc'}];
|
onRemoveAction(depChange, state, done);
|
||||||
expect(depChange(state)).toEqual({
|
|
||||||
adding_inherit_cols: false,
|
|
||||||
columns: finalCols,
|
|
||||||
});
|
|
||||||
expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(finalCols);
|
|
||||||
done();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import TablespaceSchema from '../../../pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.ui';
|
import TablespaceSchema from '../../../pgadmin/browser/server_groups/servers/tablespaces/static/js/tablespace.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -48,63 +44,19 @@ describe('TablespaceSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,14 +7,10 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import TriggerSchema, { EventSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.ui';
|
import TriggerSchema, { EventSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/triggers/static/js/trigger.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('TriggerSchema', ()=>{
|
describe('TriggerSchema', ()=>{
|
||||||
let mount;
|
let mount;
|
||||||
|
@ -42,61 +38,19 @@ describe('TriggerSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
@ -125,21 +79,7 @@ describe('TriggerSchema', ()=>{
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getCreateView(catalogSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={catalogSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('catalog properties', ()=>{
|
it('catalog properties', ()=>{
|
||||||
|
@ -155,16 +95,7 @@ describe('TriggerSchema', ()=>{
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(catalogPropertiesSchemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={catalogPropertiesSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit disableTransition', ()=>{
|
it('edit disableTransition', ()=>{
|
||||||
|
@ -190,22 +121,7 @@ describe('TriggerSchema', ()=>{
|
||||||
fires: 'AFTER'
|
fires: 'AFTER'
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit disableTransition tgnewtable', ()=>{
|
it('edit disableTransition tgnewtable', ()=>{
|
||||||
|
@ -231,22 +147,7 @@ describe('TriggerSchema', ()=>{
|
||||||
fires: 'AFTER'
|
fires: 'AFTER'
|
||||||
});
|
});
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getEditView(editSchemaObj, initData));
|
||||||
formType='dialog'
|
|
||||||
schema={editSchemaObj}
|
|
||||||
getInitData={initData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -275,61 +176,19 @@ describe('TriggerEventsSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import TriggerFunctionSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.ui';
|
import TriggerFunctionSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/functions/static/js/trigger_function.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -52,61 +48,19 @@ describe('TriggerFunctionSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
@ -121,6 +75,5 @@ describe('TriggerFunctionSchema', ()=>{
|
||||||
schemaObj.validate(state, setError);
|
schemaObj.validate(state, setError);
|
||||||
expect(setError).toHaveBeenCalledWith('prosrc', null);
|
expect(setError).toHaveBeenCalledWith('prosrc', null);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
import { getNodePrivilegeRoleSchema } from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
import { getNodePrivilegeRoleSchema } from '../../../pgadmin/browser/server_groups/servers/static/js/privilege.ui';
|
||||||
|
|
||||||
import TypeSchema, { EnumerationSchema, getCompositeSchema, getExternalSchema, getRangeSchema, getDataTypeSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui';
|
import TypeSchema, { EnumerationSchema, getCompositeSchema, getExternalSchema, getRangeSchema, getDataTypeSchema } from '../../../pgadmin/browser/server_groups/servers/databases/schemas/types/static/js/type.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
describe('TypeSchema', ()=>{
|
describe('TypeSchema', ()=>{
|
||||||
|
|
||||||
|
@ -35,12 +30,7 @@ describe('TypeSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('composite schema describe', () => {
|
describe('composite schema describe', () => {
|
||||||
|
@ -57,40 +47,8 @@ describe('TypeSchema', ()=>{
|
||||||
|
|
||||||
spyOn(compositeCollObj, 'type_options').and.returnValue(compositeCollObj.fieldOptions.types());
|
spyOn(compositeCollObj, 'type_options').and.returnValue(compositeCollObj.fieldOptions.types());
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getCreateView(compositeCollObj));
|
||||||
formType='dialog'
|
mount(getEditView(compositeCollObj, getInitData));
|
||||||
schema={compositeCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
mount(<SchemaView
|
|
||||||
formType='dialog'
|
|
||||||
schema={compositeCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('composite validate', () => {
|
it('composite validate', () => {
|
||||||
|
@ -143,40 +101,8 @@ describe('TypeSchema', ()=>{
|
||||||
()=>[]
|
()=>[]
|
||||||
);
|
);
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getCreateView(enumerationCollObj));
|
||||||
formType='dialog'
|
mount(getEditView(enumerationCollObj, getInitData));
|
||||||
schema={enumerationCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
mount(<SchemaView
|
|
||||||
formType='dialog'
|
|
||||||
schema={enumerationCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -190,40 +116,8 @@ describe('TypeSchema', ()=>{
|
||||||
spyOn(externalCollObj.fieldOptions, 'externalFunctionsList').and.returnValue([{ label: '', value: ''}, { label: 'lb1', cbtype: 'typmodin', value: 'val1'}, { label: 'lb2', cbtype: 'all', value: 'val2'}]);
|
spyOn(externalCollObj.fieldOptions, 'externalFunctionsList').and.returnValue([{ label: '', value: ''}, { label: 'lb1', cbtype: 'typmodin', value: 'val1'}, { label: 'lb2', cbtype: 'all', value: 'val2'}]);
|
||||||
spyOn(externalCollObj.fieldOptions, 'types').and.returnValue([{ label: '', value: ''}]);
|
spyOn(externalCollObj.fieldOptions, 'types').and.returnValue([{ label: '', value: ''}]);
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getCreateView(externalCollObj));
|
||||||
formType='dialog'
|
mount(getEditView(externalCollObj, getInitData));
|
||||||
schema={externalCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
mount(<SchemaView
|
|
||||||
formType='dialog'
|
|
||||||
schema={externalCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('external validate', () => {
|
it('external validate', () => {
|
||||||
|
@ -252,40 +146,8 @@ describe('TypeSchema', ()=>{
|
||||||
spyOn(rangeCollObj.fieldOptions, 'typnameList').and.returnValue([{ label: '', value: ''}, { label: 'lb1', value: 'val1'}]);
|
spyOn(rangeCollObj.fieldOptions, 'typnameList').and.returnValue([{ label: '', value: ''}, { label: 'lb1', value: 'val1'}]);
|
||||||
spyOn(rangeCollObj.fieldOptions, 'collationsList').and.returnValue([{ label: '', value: ''}, { label: 'lb1', value: 'val1'}]);
|
spyOn(rangeCollObj.fieldOptions, 'collationsList').and.returnValue([{ label: '', value: ''}, { label: 'lb1', value: 'val1'}]);
|
||||||
|
|
||||||
mount(<SchemaView
|
mount(getCreateView(rangeCollObj));
|
||||||
formType='dialog'
|
mount(getEditView(rangeCollObj, getInitData));
|
||||||
schema={rangeCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
mount(<SchemaView
|
|
||||||
formType='dialog'
|
|
||||||
schema={rangeCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('range validate', () => {
|
it('range validate', () => {
|
||||||
|
@ -305,41 +167,8 @@ describe('TypeSchema', ()=>{
|
||||||
it('data type collection', ()=>{
|
it('data type collection', ()=>{
|
||||||
|
|
||||||
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue([]);
|
||||||
|
mount(getCreateView(dataTypeObj));
|
||||||
mount(<SchemaView
|
mount(getEditView(dataTypeObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={dataTypeObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
|
|
||||||
mount(<SchemaView
|
|
||||||
formType='dialog'
|
|
||||||
schema={dataTypeObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('tlength editable', ()=>{
|
it('tlength editable', ()=>{
|
||||||
|
@ -391,54 +220,14 @@ describe('TypeSchema', ()=>{
|
||||||
);
|
);
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(typeSchemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={typeSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(typeSchemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={typeSchemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
getInitData={getInitData}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(typeSchemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={typeSchemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,17 +7,14 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
import { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView, { SCHEMA_STATE_ACTIONS } from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
import BaseUISchema from '../../../pgadmin/static/js/SchemaView/base_schema.ui';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import UniqueConstraintSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.ui';
|
import UniqueConstraintSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/index_constraint/static/js/unique_constraint.ui';
|
||||||
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
import TableSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class SchemaInColl extends BaseUISchema {
|
class SchemaInColl extends BaseUISchema {
|
||||||
constructor(schemaObj) {
|
constructor(schemaObj) {
|
||||||
|
@ -59,83 +56,24 @@ describe('UniqueConstraintSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create collection', ()=>{
|
it('create collection', ()=>{
|
||||||
let schemaCollObj = new SchemaInColl(schemaObj);
|
let schemaCollObj = new SchemaInColl(schemaObj);
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(schemaCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,15 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import UserMappingSchema from '../../../pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/static/js/user_mapping.ui';
|
import UserMappingSchema from '../../../pgadmin/browser/server_groups/servers/databases/foreign_data_wrappers/foreign_servers/user_mappings/static/js/user_mapping.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -47,63 +43,19 @@ describe('UserMappingSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -7,17 +7,12 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import VariableSchema, {getNodeVariableSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/variable.ui';
|
import VariableSchema, {getNodeVariableSchema} from '../../../pgadmin/browser/server_groups/servers/static/js/variable.ui';
|
||||||
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
import * as nodeAjax from '../../../pgadmin/browser/static/js/node_ajax';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
/* Used to check collection mode */
|
/* Used to check collection mode */
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
|
@ -59,64 +54,19 @@ describe('VariableSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
pgAdmin.Browser.utils.support_ssh_tunnel = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('getValueFieldProps', ()=>{
|
it('getValueFieldProps', ()=>{
|
||||||
|
@ -134,25 +84,8 @@ describe('VariableSchema', ()=>{
|
||||||
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeAjaxOptions').and.returnValue([]);
|
||||||
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
spyOn(nodeAjax, 'getNodeListByName').and.returnValue([]);
|
||||||
let varCollObj = new MockSchema(()=>getNodeVariableSchema({}, {server: {user: {name: 'postgres'}}}, {}, true, true));
|
let varCollObj = new MockSchema(()=>getNodeVariableSchema({}, {server: {user: {name: 'postgres'}}}, {}, true, true));
|
||||||
let ctrl = mount(<SchemaView
|
let ctrl = mount(getCreateView(varCollObj));
|
||||||
formType='dialog'
|
|
||||||
schema={varCollObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
/* Make sure you hit every corner */
|
/* Make sure you hit every corner */
|
||||||
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
ctrl.find('DataGridView').at(0).find('PgIconButton[data-test="add-row"]').find('button').simulate('click');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
@ -7,16 +7,11 @@
|
||||||
//
|
//
|
||||||
//////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
import jasmineEnzyme from 'jasmine-enzyme';
|
|
||||||
import React from 'react';
|
|
||||||
import '../helper/enzyme.helper';
|
import '../helper/enzyme.helper';
|
||||||
import { createMount } from '@material-ui/core/test-utils';
|
import { createMount } from '@material-ui/core/test-utils';
|
||||||
import pgAdmin from 'sources/pgadmin';
|
|
||||||
import {messages} from '../fake_messages';
|
|
||||||
import SchemaView from '../../../pgadmin/static/js/SchemaView';
|
|
||||||
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
import BaseUISchema from 'sources/SchemaView/base_schema.ui';
|
||||||
import ViewSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.ui';
|
import ViewSchema from '../../../pgadmin/browser/server_groups/servers/databases/schemas/views/static/js/view.ui';
|
||||||
|
import {genericBeforeEach, getCreateView, getEditView, getPropertiesView} from '../genericFunctions';
|
||||||
|
|
||||||
class MockSchema extends BaseUISchema {
|
class MockSchema extends BaseUISchema {
|
||||||
get baseFields() {
|
get baseFields() {
|
||||||
|
@ -51,63 +46,19 @@ describe('ViewSchema', ()=>{
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(()=>{
|
beforeEach(()=>{
|
||||||
jasmineEnzyme();
|
genericBeforeEach();
|
||||||
/* messages used by validators */
|
|
||||||
pgAdmin.Browser = pgAdmin.Browser || {};
|
|
||||||
pgAdmin.Browser.messages = pgAdmin.Browser.messages || messages;
|
|
||||||
pgAdmin.Browser.utils = pgAdmin.Browser.utils || {};
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('create', ()=>{
|
it('create', ()=>{
|
||||||
mount(<SchemaView
|
mount(getCreateView(schemaObj));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'create',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('edit', ()=>{
|
it('edit', ()=>{
|
||||||
mount(<SchemaView
|
mount(getEditView(schemaObj, getInitData));
|
||||||
formType='dialog'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'edit',
|
|
||||||
}}
|
|
||||||
onSave={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onClose={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onDataChange={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
confirmOnCloseReset={false}
|
|
||||||
hasSQL={false}
|
|
||||||
disableSqlHelp={false}
|
|
||||||
disableDialogHelp={false}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('properties', ()=>{
|
it('properties', ()=>{
|
||||||
mount(<SchemaView
|
mount(getPropertiesView(schemaObj, getInitData));
|
||||||
formType='tab'
|
|
||||||
schema={schemaObj}
|
|
||||||
getInitData={getInitData}
|
|
||||||
viewHelperProps={{
|
|
||||||
mode: 'properties',
|
|
||||||
}}
|
|
||||||
onHelp={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
onEdit={()=>{/*This is intentional (SonarQube)*/}}
|
|
||||||
/>);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('validate', ()=>{
|
it('validate', ()=>{
|
||||||
|
|
Loading…
Reference in New Issue