From c87167c8c6cada3a4b8419560f95822cbd9dcccf Mon Sep 17 00:00:00 2001 From: Nico Rehwaldt Date: Wed, 13 Jan 2021 14:20:26 +0100 Subject: [PATCH] test: do not double add test-container class This prevents the .test-container selector to appear twice in our test markup: ```html
``` With this commit we only add the .test-content-container marker in cases where `mocha-test-container-support` is not present upon running `bootstrapBpmnJS`. --- test/TestHelper.js | 2 +- test/helper/index.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/TestHelper.js b/test/TestHelper.js index f7f6dcf7..d1f4c90a 100644 --- a/test/TestHelper.js +++ b/test/TestHelper.js @@ -10,7 +10,7 @@ insertCSS('bpmn-embedded.css', require('bpmn-font/dist/css/bpmn-embedded.css')); insertCSS('diagram-js-testing.css', 'body .test-container { height: auto }' + - 'body .test-container .test-content-container { height: 90vmin; }' + 'body .test-content-container { height: 90vh; }' ); diff --git a/test/helper/index.js b/test/helper/index.js index 7cbf8e94..8a0ab180 100644 --- a/test/helper/index.js +++ b/test/helper/index.js @@ -72,11 +72,11 @@ export function bootstrapBpmnJS(BpmnJS, diagram, options, locals) { testContainer = TestContainer.get(this); } catch (e) { testContainer = document.createElement('div'); + testContainer.classList.add('test-content-container'); + document.body.appendChild(testContainer); } - testContainer.classList.add('test-container'); - var _options = options, _locals = locals;