From 8407178e44d6703b5071b67fbee9f4673e67c8b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Souchet=20C=C3=A9line?= Date: Fri, 25 Aug 2023 17:38:09 +0200 Subject: [PATCH] revert bad changes --- src/component/parser/json/converter/ProcessConverter.ts | 6 +----- test/unit/helpers/bpmn-model-expect.ts | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/component/parser/json/converter/ProcessConverter.ts b/src/component/parser/json/converter/ProcessConverter.ts index aebea751c0..942c621e79 100644 --- a/src/component/parser/json/converter/ProcessConverter.ts +++ b/src/component/parser/json/converter/ProcessConverter.ts @@ -365,13 +365,9 @@ export default class ProcessConverter { const buildMarkers = (bpmnElement: TActivity): ShapeBpmnMarkerKind[] => { const markers: ShapeBpmnMarkerKind[] = []; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- We know that the standardLoopCharacteristics field is not on all types, but it's already tested - // @ts-ignore const standardLoopCharacteristics = bpmnElement.standardLoopCharacteristics; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- We know that the multiInstanceLoopCharacteristics field is not on all types, but it's already tested - // @ts-ignore const multiInstanceLoopCharacteristics = ensureIsArray(bpmnElement.multiInstanceLoopCharacteristics, true)[0]; - if (standardLoopCharacteristics ?? standardLoopCharacteristics === '') { + if (standardLoopCharacteristics !== undefined || standardLoopCharacteristics === '') { markers.push(ShapeBpmnMarkerKind.LOOP); } else if (multiInstanceLoopCharacteristics) { markers.push(multiInstanceLoopCharacteristics.isSequential ? ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL : ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL); diff --git a/test/unit/helpers/bpmn-model-expect.ts b/test/unit/helpers/bpmn-model-expect.ts index b76e2f5648..43dca2749a 100644 --- a/test/unit/helpers/bpmn-model-expect.ts +++ b/test/unit/helpers/bpmn-model-expect.ts @@ -43,7 +43,7 @@ export interface ExpectedActivityShape extends ExpectedShape { export interface ExpectedCallActivityShape extends ExpectedActivityShape { bpmnElementGlobalTaskKind?: GlobalTaskKind; - bpmnElementCallActivityKind?: ShapeBpmnCallActivityKind; + bpmnElementCallActivityKind: ShapeBpmnCallActivityKind; } export interface ExpectedEventShape extends ExpectedShape { @@ -114,7 +114,7 @@ export const verifyShape = ( expect(bpmnElement.markers).toHaveLength(0); } - if (('bpmnElementCallActivityKind' in expectedShape && expectedShape.bpmnElementCallActivityKind) ?? 'bpmnElementGlobalTaskKind' in expectedShape) { + if ('bpmnElementCallActivityKind' in expectedShape || 'bpmnElementGlobalTaskKind' in expectedShape) { expect(bpmnElement instanceof ShapeBpmnCallActivity).toBeTruthy(); expect((bpmnElement as ShapeBpmnCallActivity).callActivityKind).toEqual(expectedShape.bpmnElementCallActivityKind); expect((bpmnElement as ShapeBpmnCallActivity).globalTaskKind).toEqual(expectedShape.bpmnElementGlobalTaskKind);