Skip to content

Commit

Permalink
ci: test both supported bpmn-js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Feb 9, 2022
1 parent 8306e8b commit 47bdc01
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 119 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
matrix:
os: [ ubuntu-latest ]
node-version: [ 14 ]
integration-deps:
- diagram-js@7.x bpmn-js@8.x
- diagram-js@8.x bpmn-js@9.0.0-alpha.2

runs-on: ${{ matrix.os }}

Expand All @@ -28,6 +31,8 @@ jobs:
${{ runner.OS }}-
- name: Install dependencies
run: npm ci
- name: Install dependencies for integration
run: npm install ${{ matrix.integration-deps }}
- name: Build
env:
COVERAGE: 1
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@testing-library/preact": "^2.0.1",
"babel-loader": "^8.2.2",
"bpmn-js": "9.0.0-alpha.2",
"bpmn-js-legacy": "npm:bpmn-js@^8.9.1",
"bpmn-moddle": "^7.1.2",
"camunda-bpmn-moddle": "^6.1.1",
"chai": "^4.3.4",
Expand Down
18 changes: 14 additions & 4 deletions test/TestHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,20 @@ export function insertBpmnStyles() {
require('bpmn-js/dist/assets/diagram-js.css').default
);

insertCSS(
'bpmn-js.css',
require('bpmn-js/dist/assets/bpmn-js.css').default
);
// @barmac: this fails before bpmn-js@9
try {
insertCSS(
'bpmn-js.css',
require('bpmn-js/dist/assets/bpmn-js.css').default
);
} catch (error) {
const bpmnJsVersion = require('bpmn-js/package.json').version;

// rethrow for unexpected error
if (!bpmnJsVersion.startsWith('8')) {
throw error;
}
}

insertCSS(
'bpmn-font.css',
Expand Down
114 changes: 0 additions & 114 deletions test/spec/BpmnPropertiesPanelRenderer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import {

import Modeler from 'bpmn-js/lib/Modeler';

import LegacyModeler from 'bpmn-js-legacy/lib/Modeler';

import BpmnPropertiesPanel from 'src/render';

import BpmnPropertiesProvider from 'src/provider/bpmn';
Expand Down Expand Up @@ -246,118 +244,6 @@ describe('<BpmnPropertiesPanelRenderer>', function() {
});


describe('bpmn-js@8', function() {

it('should import simple process (cloud)', async function() {

// given
const diagramXml = require('test/fixtures/simple.bpmn').default;

// when
const result = await createModeler(
diagramXml,
{
additionalModules: [
ZeebeModdleExtension,
BpmnPropertiesPanel,
BpmnPropertiesProvider,
ZeebePropertiesProvider
],
moddleExtensions: {
zeebe: ZeebeModdle
},
description: DescriptionProvider
},
LegacyModeler
);

// then
expect(result.error).not.to.exist;
});


it('should import simple process (platform)', async function() {

// given
const diagramXml = require('test/fixtures/simple.bpmn').default;

// when
const result = await createModeler(
diagramXml,
{
additionalModules: [
CamundaModdleExtension,
BpmnPropertiesPanel,
BpmnPropertiesProvider,
CamundaPropertiesProvider
],
moddleExtensions: {
camunda: CamundaModdle
}
},
LegacyModeler
);

// then
expect(result.error).not.to.exist;
});


it('should import simple process (bpmn)', async function() {

// given
const diagramXml = require('test/fixtures/simple.bpmn').default;

// when
const result = await createModeler(
diagramXml,
{
additionalModules: [
CamundaModdleExtension,
BpmnPropertiesPanel,
BpmnPropertiesProvider
]
},
LegacyModeler
);

// then
expect(result.error).not.to.exist;
});


it('should import simple process (templates)', async function() {

// given
const diagramXml = require('test/spec/provider/element-templates/fixtures/complex.bpmn').default;

const elementTemplates = require('test/spec/provider/element-templates/fixtures/complex.json');

// when
const result = await createModeler(
diagramXml,
{
additionalModules: [
CamundaModdleExtension,
BpmnPropertiesPanel,
BpmnPropertiesProvider,
ElementTemplatesPropertiesProvider
],
moddleExtensions: {
camunda: CamundaModdle
},
elementTemplates
},
LegacyModeler
);

// then
expect(result.error).not.to.exist;
});

});


it('should attach on diagram.init', async function() {

// given
Expand Down

0 comments on commit 47bdc01

Please sign in to comment.