mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-25 18:20:20 -06:00
35 lines
847 B
JavaScript
35 lines
847 B
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2024, The pgAdmin Development Team
|
|
// This software is released under the PostgreSQL Licence
|
|
//
|
|
//////////////////////////////////////////////////////////////
|
|
import ERDModel from 'pgadmin.tools.erd/erd_tool/ERDModel';
|
|
|
|
describe('ERDModel', ()=>{
|
|
it('getNodesDict', ()=>{
|
|
let model = new ERDModel();
|
|
|
|
jest.spyOn(model, 'getNodes').mockReturnValue([
|
|
{
|
|
name: 'test1',
|
|
getID: function() {
|
|
return 'id1';
|
|
},
|
|
},
|
|
{
|
|
name: 'test2',
|
|
getID: function() {
|
|
return 'id2';
|
|
},
|
|
},
|
|
]);
|
|
expect(JSON.stringify(model.getNodesDict())).toBe(JSON.stringify({
|
|
'id1': {name: 'test1'},
|
|
'id2': {name: 'test2'},
|
|
}));
|
|
});
|
|
});
|