Attempt to fix failing JS test cases with error related to ERD.

This commit is contained in:
Aditya Toshniwal 2023-04-24 18:04:02 +05:30
parent 32fb3f3c1f
commit 4c2ae44e4c
2 changed files with 3 additions and 3 deletions

View File

@ -973,7 +973,7 @@ class ERDTool extends React.Component {
<ERDCanvasSettings.Provider value={{
cardinality_notation: this.state.cardinality_notation
}}>
{!this.props.inTest && <CanvasWidget className={this.props.classes.diagramCanvas} ref={(ele)=>{this.canvasEle = ele?.ref?.current;}} engine={this.diagram.getEngine()} />}
{!this.props.isTest && <CanvasWidget className={this.props.classes.diagramCanvas} ref={(ele)=>{this.canvasEle = ele?.ref?.current;}} engine={this.diagram.getEngine()} />}
</ERDCanvasSettings.Provider>
</div>
</Box>
@ -1001,7 +1001,7 @@ ERDTool.propTypes = {
pgAdmin: PropTypes.object.isRequired,
panel: PropTypes.object,
classes: PropTypes.object,
inTest: PropTypes.bool,
isTest: PropTypes.bool,
};
export const ERDCanvasSettings = React.createContext({});

View File

@ -15,7 +15,7 @@ import { PortModelAlignment } from '@projectstorm/react-diagrams';
describe('ERDCore', ()=>{
let eleFactory = jasmine.createSpyObj('nodeFactories', {
'registerFactory': null,
'getFactory': jasmine.createSpyObj('getFactory', ['generateModel', 'calculateRoutingMatrix']),
'getFactory': jasmine.createSpyObj('getFactory', ['generateModel']),
});
let erdEngine = jasmine.createSpyObj('engine', {
'getNodeFactories': eleFactory,