Skip to content

Commit

Permalink
test: add modeler select to npm start test
Browse files Browse the repository at this point in the history
  • Loading branch information
philippfromme authored and merge-me[bot] committed Nov 22, 2023
1 parent cb42b54 commit 1f86374
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions test/spec/modeler/Linting.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,18 @@ describe('Linting', function() {
})
};

const linter = new Linter({
plugins: [
FooPlugin
]
});
let modeler = 'desktop';

const createLinter = modeler => {
return new Linter({
modeler,
plugins: [
FooPlugin
]
});
};

let linter = createLinter(modeler);

const lint = () => {
const definitions = bpmnjs.getDefinitions();
Expand Down Expand Up @@ -204,6 +211,11 @@ describe('Linting', function() {
<div>
<label>Execution Platform Version</label>
<input type="text" />
<label>Modeler</label>
<select>
<option value="desktop">Desktop</option>
<option value="web">Web</option>
</select>
<button>Deactivate Linting</button>
</div>
</div>
Expand All @@ -221,6 +233,16 @@ describe('Linting', function() {
);
});

panel.querySelector('select').value = modeler;

panel.querySelector('select').addEventListener('change', ({ target }) => {
modeler = target.value;

linter = createLinter(modeler);

lint();
});

panel.querySelector('button').addEventListener('click', () => {
if (linting.isActive()) {
linting.deactivate();
Expand Down

0 comments on commit 1f86374

Please sign in to comment.