test: do not double add test-container class

This prevents the .test-container selector to appear twice in our test
markup:

```html
<div class="test-container passed" id="camunda-properties simple should
open stuff">
  <div class="title-row">
    <a href="#camunda-properties%20simple%20should%20open%20stuff">
<h3 class="test-titel">camunda-properties simple should open
stuff</h3>
    </a>
    <div class="test-result" style="float: right;">passed</div>
  </div>
  <div class="test-content-container test-container">
    <!-- test content -->
  </div>
</div>
```

With this commit we only add the .test-content-container marker in cases
where `mocha-test-container-support` is not present upon running
`bootstrapBpmnJS`.
This commit is contained in:
Nico Rehwaldt 2021-01-13 14:20:26 +01:00 committed by fake-join[bot]
parent 6563e49261
commit c87167c8c6
2 changed files with 3 additions and 3 deletions

View File

@ -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; }'
);

View File

@ -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;