Skip to content

Commit

Permalink
test: add config test for data types
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Feb 24, 2022
1 parent f5c012b commit 7214517
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions packages/dmn-js/test/spec/ModelerSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,37 @@ describe('Modeler', function() {
expect(element.id).to.eql(tableView.element.id);
});


describe('config', function() {

it('should use data types provided via <common.dataTypes>', async function() {

// given
editor = new Modeler({
container: container,
common: {
keyboard: {
bindTo: document
},
dataTypes: [
'double',
'long'
]
}
});
await editor.importXML(diagram);
const decisionTableView = editor.getViews().find(v => v.type === 'decisionTable');
editor.open(decisionTableView);

// when
const dataTypes = editor.getActiveViewer().get('dataTypes');
const dataTypesList = dataTypes.getAll();

// then
expect(dataTypesList).to.eql([
'double',
'long'
]);
});
});
});

0 comments on commit 7214517

Please sign in to comment.