diff --git a/test/e2e/ExpectModelUtils.ts b/test/e2e/ExpectModelUtils.ts index bf93a5cce8..f4fddfff03 100644 --- a/test/e2e/ExpectModelUtils.ts +++ b/test/e2e/ExpectModelUtils.ts @@ -30,6 +30,7 @@ import { toBeTask, toBeServiceTask, toBeUserTask, + toBeReceiveTask, } from './matchers'; declare global { @@ -47,6 +48,7 @@ declare global { toBeTask(modelElement: ExpectedShapeModelElement): R; toBeServiceTask(modelElement: ExpectedShapeModelElement): R; toBeUserTask(modelElement: ExpectedShapeModelElement): R; + toBeReceiveTask(modelElement: ExpectedShapeModelElement): R; } } } @@ -63,6 +65,7 @@ expect.extend({ toBeTask, toBeServiceTask, toBeUserTask, + toBeReceiveTask, }); export interface ExpectedCellWithGeometry { diff --git a/test/e2e/matchers/index.ts b/test/e2e/matchers/index.ts index 42182c1545..896f85d626 100644 --- a/test/e2e/matchers/index.ts +++ b/test/e2e/matchers/index.ts @@ -14,6 +14,6 @@ * limitations under the License. */ export { toBeSequenceFlow, toBeMessageFlow, toBeAssociationFlow } from './toBeEdge'; -export { toBeShape, toBeCallActivity, toBeTask, toBeServiceTask, toBeUserTask } from './toBeShape'; +export { toBeShape, toBeCallActivity, toBeTask, toBeServiceTask, toBeUserTask, toBeReceiveTask } from './toBeShape'; export { toBeCell, toBeCellWithParentAndGeometry } from './toBeCell'; export { withFont } from './withFont'; diff --git a/test/e2e/matchers/toBeShape/index.ts b/test/e2e/matchers/toBeShape/index.ts index 9bcbb756b0..782cab97d4 100644 --- a/test/e2e/matchers/toBeShape/index.ts +++ b/test/e2e/matchers/toBeShape/index.ts @@ -92,3 +92,7 @@ export function toBeServiceTask(this: MatcherContext, received: string, expected export function toBeUserTask(this: MatcherContext, received: string, expected: ExpectedShapeModelElement): CustomMatcherResult { return buildCellMatcher('toBeUserTask', this, received, { ...expected, kind: ShapeBpmnElementKind.TASK_USER }, 'Shape', buildExpectedCell); } + +export function toBeReceiveTask(this: MatcherContext, received: string, expected: ExpectedShapeModelElement): CustomMatcherResult { + return buildCellMatcher('toBeReceiveTask', this, received, { ...expected, kind: ShapeBpmnElementKind.TASK_RECEIVE }, 'Shape', buildExpectedCell); +} diff --git a/test/e2e/mxGraph.model.test.ts b/test/e2e/mxGraph.model.test.ts index 0ef449bb18..94f9c736d1 100644 --- a/test/e2e/mxGraph.model.test.ts +++ b/test/e2e/mxGraph.model.test.ts @@ -800,28 +800,24 @@ describe('mxGraph model', () => { }); // Receive Task: Non instantiating - expect('receive_task_non_instantiating_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_non_instantiating_id').toBeReceiveTask({ label: 'Non-instantiating Receive Task', isInstantiating: false, parentId: 'participant_1_id', }); - expect('receive_task_non_instantiating_with_loop_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_non_instantiating_with_loop_id').toBeReceiveTask({ label: 'Non-instantiating Receive Task With Loop', isInstantiating: false, markers: [ShapeBpmnMarkerKind.LOOP], parentId: 'participant_1_id', }); - expect('receive_task_non_instantiating_with_sequential_multi_instance_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_non_instantiating_with_sequential_multi_instance_id').toBeReceiveTask({ label: 'Non-instantiating Receive Task With Sequential Multi-instance', isInstantiating: false, markers: [ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL], parentId: 'participant_1_id', }); - expect('receive_task_non_instantiating_with_parallel_multi_instance_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_non_instantiating_with_parallel_multi_instance_id').toBeReceiveTask({ label: 'Non-instantiating Receive Task With Parallel Multi-instance', isInstantiating: false, markers: [ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL], @@ -829,28 +825,24 @@ describe('mxGraph model', () => { }); // Receive Task: Instantiating - expect('receive_task_instantiating_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_instantiating_id').toBeReceiveTask({ label: 'Instantiating Receive Task', isInstantiating: true, parentId: 'participant_1_id', }); - expect('receive_task_instantiating_with_loop_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_instantiating_with_loop_id').toBeReceiveTask({ label: 'Instantiating Receive Task With Loop', isInstantiating: true, markers: [ShapeBpmnMarkerKind.LOOP], parentId: 'participant_1_id', }); - expect('receive_task_instantiating_with_sequential_multi_instance_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_instantiating_with_sequential_multi_instance_id').toBeReceiveTask({ label: 'Instantiating Receive Task With Sequential Multi-instance', isInstantiating: true, markers: [ShapeBpmnMarkerKind.MULTI_INSTANCE_SEQUENTIAL], parentId: 'participant_1_id', }); - expect('receive_task_instantiating_with_parallel_multi_instance_id').toBeShape({ - kind: ShapeBpmnElementKind.TASK_RECEIVE, + expect('receive_task_instantiating_with_parallel_multi_instance_id').toBeReceiveTask({ label: 'Instantiating Receive Task With Parallel Multi-instance', isInstantiating: true, markers: [ShapeBpmnMarkerKind.MULTI_INSTANCE_PARALLEL],