mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2024-11-22 08:46:39 -06:00
35 lines
842 B
JavaScript
35 lines
842 B
JavaScript
/////////////////////////////////////////////////////////////
|
|
//
|
|
// pgAdmin 4 - PostgreSQL Tools
|
|
//
|
|
// Copyright (C) 2013 - 2023, 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();
|
|
|
|
spyOn(model, 'getNodes').and.returnValue([
|
|
{
|
|
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'},
|
|
}));
|
|
});
|
|
});
|