Skip to content

Commit 8215ae3

Browse files
author
Niklas Kiefer
committed
test(editor): always provide default modules when not configured
1 parent 38ca4aa commit 8215ae3

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

packages/form-js-editor/test/helper/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,15 @@ export function bootstrapFormEditor(schema, options, locals) {
8585
}
8686
}, OPTIONS, _options);
8787

88+
if (_locals) {
89+
const mockModule = {};
8890

89-
const mockModule = {};
90-
91-
forEach(_locals, function(value, key) {
92-
mockModule[ key ] = [ 'value', value ];
93-
});
91+
forEach(_locals, function(value, key) {
92+
mockModule[ key ] = [ 'value', value ];
93+
});
9494

95-
_options.modules = [].concat(_options.modules || [], [ mockModule ]);
95+
_options.modules = [].concat(_options.modules || [], [ mockModule ]);
96+
}
9697

9798
// remove previous instance
9899
cleanup();

packages/form-js-editor/test/spec/features/modeling/Modeling.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ insertStyles();
1616
describe('features/modeling', function() {
1717

1818
beforeEach(bootstrapFormEditor(schema, {
19-
additionalModules: [
19+
modules: [
2020
modelingModule
2121
]
2222
}));

packages/form-js-editor/test/spec/features/modeling/behavior/IdBehavior.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import schema from '../../../form.json';
1111
describe('features/modeling - IdBehavior', function() {
1212

1313
beforeEach(bootstrapFormEditor(schema, {
14-
additionalModules: [
14+
modules: [
1515
modelingModule
1616
]
1717
}));

0 commit comments

Comments
 (0)