Skip to content

Commit

Permalink
simplify the initialization of the json to set as parameter of the Js…
Browse files Browse the repository at this point in the history
…onParser in the unit tests for markers
  • Loading branch information
csouchet committed Aug 21, 2023
1 parent 5f1a893 commit 4fc7de9
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions test/unit/component/parser/json/BpmnJsonParser.marker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import type { BpmnJsonModel } from '@lib/model/bpmn/json/BPMN20';
import { parseJsonAndExpectOnlyFlowNodes } from '../../../helpers/JsonTestUtils';
import { getExpectedMarkers, verifyShape } from '../../../helpers/bpmn-model-expect';

import type { TProcess } from '@lib/model/bpmn/json/baseElement/rootElement/rootElement';
import type { TMultiInstanceLoopCharacteristics, TStandardLoopCharacteristics } from '@lib/model/bpmn/json/baseElement/loopCharacteristics';
import { ShapeBpmnCallActivityKind, ShapeBpmnElementKind, ShapeBpmnMarkerKind } from '@lib/model/bpmn/internal';

Expand Down Expand Up @@ -57,7 +56,9 @@ describe.each([
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
process: {},
process: {
[bpmnSemanticType]: { id: `${bpmnSemanticType}_id_0`, name: `${bpmnSemanticType} name`, [bpmnLoopCharacteristicsKind]: loopCharacteristics },
},
BPMNDiagram: {
name: 'process 0',
BPMNPlane: {
Expand All @@ -71,11 +72,6 @@ describe.each([
},
},
};
(json.definitions.process as TProcess)[bpmnSemanticType] = {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
};
(json.definitions.process as TProcess)[bpmnSemanticType][bpmnLoopCharacteristicsKind] = loopCharacteristics;

const model = parseJsonAndExpectOnlyFlowNodes(json, 1);

Expand All @@ -97,7 +93,13 @@ describe.each([
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
process: {},
process: {
[bpmnSemanticType]: {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
[bpmnLoopCharacteristicsKind]: '',
},
},
BPMNDiagram: {
name: 'process 0',
BPMNPlane: {
Expand All @@ -111,11 +113,6 @@ describe.each([
},
},
};
(json.definitions.process as TProcess)[bpmnSemanticType] = {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
};
(json.definitions.process as TProcess)[bpmnSemanticType][bpmnLoopCharacteristicsKind] = '';

const model = parseJsonAndExpectOnlyFlowNodes(json, 1);

Expand Down Expand Up @@ -143,7 +140,13 @@ describe.each([
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
process: {},
process: {
[bpmnSemanticType]: {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
multiInstanceLoopCharacteristics: loopCharacteristics,
},
},
BPMNDiagram: {
name: 'process 0',
BPMNPlane: {
Expand All @@ -157,11 +160,6 @@ describe.each([
},
},
};
(json.definitions.process as TProcess)[bpmnSemanticType] = {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
multiInstanceLoopCharacteristics: loopCharacteristics,
};

const model = parseJsonAndExpectOnlyFlowNodes(json, 1);

Expand All @@ -183,7 +181,13 @@ describe.each([
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
process: {},
process: {
[bpmnSemanticType]: {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
multiInstanceLoopCharacteristics: { isSequential },
},
},
BPMNDiagram: {
name: 'process 0',
BPMNPlane: {
Expand All @@ -197,11 +201,6 @@ describe.each([
},
},
};
(json.definitions.process as TProcess)[bpmnSemanticType] = {
id: `${bpmnSemanticType}_id_0`,
name: `${bpmnSemanticType} name`,
multiInstanceLoopCharacteristics: { isSequential },
};

const model = parseJsonAndExpectOnlyFlowNodes(json, 1);

Expand Down

0 comments on commit 4fc7de9

Please sign in to comment.