chore(test): assign fixed height to test containers

This commit is contained in:
Nico Rehwaldt 2014-11-20 12:55:15 +01:00
parent 51918b3493
commit 3d66502ee8
3 changed files with 10 additions and 4 deletions

View File

@ -40,7 +40,7 @@
"grunt-jsdoc": "^0.5.1",
"grunt-karma": "^0.8.0",
"grunt-release": "^0.7.0",
"jasmine-test-container-support": "0.0.1",
"jasmine-test-container-support": "^0.1.1",
"jsondiffpatch": "^0.1.7",
"karma": "^0.12.12",
"karma-browserify": "^1.0.0",

View File

@ -2,5 +2,9 @@ var TestHelper = module.exports = require('./helper');
var fs = require('fs');
TestHelper.insertCSS('diagram-js.css', fs.readFileSync(__dirname + '/../node_modules/diagram-js/assets/diagram-js.css', 'utf-8'));
TestHelper.insertCSS('bpmn-embedded.css', fs.readFileSync(__dirname + '/../assets/bpmn-font/css/bpmn-embedded.css', 'utf-8'));
TestHelper.insertCSS('diagram-js.css', fs.readFileSync(__dirname + '/../node_modules/diagram-js/assets/diagram-js.css', 'utf8'));
TestHelper.insertCSS('bpmn-embedded.css', fs.readFileSync(__dirname + '/../assets/bpmn-font/css/bpmn-embedded.css', 'utf8'));
TestHelper.insertCSS('diagram-js-testing.css',
'.test-container .result { height: 500px; }' + '.test-container > div'
);

View File

@ -62,6 +62,8 @@ function bootstrapBpmnJS(BpmnJS, options, locals) {
document.body.appendChild(testContainer);
}
testContainer.classList.add('test-container');
var _options = options,
_locals = locals;
@ -78,7 +80,7 @@ function bootstrapBpmnJS(BpmnJS, options, locals) {
_locals = _locals();
}
_options = _.extend({ container: testContainer }, OPTIONS || {}, _options || {});
_options = _.extend({ container: testContainer, width: '100%', height: '100%' }, OPTIONS || {}, _options || {});
if (_locals) {
var mockModule = {};