mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Added support to allow tables to be dragged to ERD Tool. Fixes #6241
This commit is contained in:
committed by
Akshay Joshi
parent
476d7c5fc9
commit
7f3c3fa6f9
@@ -101,6 +101,7 @@ describe('ERDCore', ()=>{
|
||||
initialConfig: {
|
||||
otherInfo: {
|
||||
data:data,
|
||||
dataUrl: null,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -24,6 +24,11 @@ export class FakeNode {
|
||||
retVal.name = tabName;
|
||||
return retVal;
|
||||
}
|
||||
getMetadata() {
|
||||
return {
|
||||
is_promise: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
export class FakeLink {
|
||||
|
||||
@@ -63,15 +63,6 @@ describe('ERD TableNodeModel', ()=>{
|
||||
expect(modelObj.getData().name).toBe('changedName');
|
||||
});
|
||||
|
||||
it('cloneData', ()=>{
|
||||
modelObj.addColumn({name: 'col1', not_null:false, attnum: 0});
|
||||
expect(modelObj.cloneData('clonedNode')).toEqual({
|
||||
name: 'clonedNode',
|
||||
schema: 'erd',
|
||||
columns: [{name: 'col1', not_null:false, attnum: 0}],
|
||||
});
|
||||
});
|
||||
|
||||
describe('setData', ()=>{
|
||||
let existPort = jasmine.createSpyObj('port', {
|
||||
'removeAllLinks': jasmine.createSpy('removeAllLinks'),
|
||||
@@ -196,6 +187,9 @@ describe('ERD TableNodeModel', ()=>{
|
||||
schema: 'erd',
|
||||
},
|
||||
note: 'some note',
|
||||
metadata: {
|
||||
data_failed: false, is_promise: false
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
@@ -178,7 +178,7 @@ describe('ERD BodyWidget', ()=>{
|
||||
});
|
||||
|
||||
it('event nodesSelectionChanged', (done)=>{
|
||||
spyOn(bodyInstance.diagram, 'getSelectedNodes').and.returnValue([{key:'value'}]);
|
||||
spyOn(bodyInstance.diagram, 'getSelectedNodes').and.returnValue([new FakeNode({key:'value'})]);
|
||||
bodyInstance.diagram.fireEvent({}, 'nodesSelectionChanged', true);
|
||||
setTimeout(()=>{
|
||||
expect(body.state().single_node_selected).toBe(true);
|
||||
|
||||
Reference in New Issue
Block a user