Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(JsonBuilder): add new properties for link events #2895

Merged
merged 8 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

import type { ExpectedShape } from '../../../helpers/bpmn-model-expect';
import type { BuildCallActivityParameter, BuildGatewayKind, BuildTaskKind, OtherBuildEventKind, BpmnGlobalTaskKind } from '../../../helpers/JsonBuilder';
import type { BuildCallActivityParameter, BuildGatewayKind, BuildTaskKind, BuildNotBoundaryEventKind, BpmnGlobalTaskKind } from '../../../helpers/JsonBuilder';
import type { GlobalTaskKind } from '@lib/model/bpmn/internal';
import type { BpmnJsonModel } from '@lib/model/bpmn/json/bpmn20';

Expand Down Expand Up @@ -215,7 +215,7 @@ describe('parse bpmn as json for callActivity', () => {
id: 'process_1',
event: {
id: `${expectedBpmnElementKind}_id`,
bpmnKind: expectedBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: { eventDefinitionKind: 'message', eventDefinitionOn: EventDefinitionOn.EVENT },
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import type { BuildEventDefinition, OtherBuildEventKind } from '../../../helpers/JsonBuilder';
import type { BuildEventDefinition, BuildNotBoundaryEventKind } from '../../../helpers/JsonBuilder';

import { verifyShape } from '../../../helpers/bpmn-model-expect';
import { buildDefinitions, EventDefinitionOn } from '../../../helpers/JsonBuilder';
Expand All @@ -31,7 +31,7 @@ describe.each([
])('for none %s', (expectedShapeBpmnElementKind: ShapeBpmnElementKind, allDefinitionKinds: BuildEventDefinition[]) => {
executeEventCommonTests(
{
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: { eventDefinitionOn: EventDefinitionOn.NONE },
},
{
Expand All @@ -49,27 +49,27 @@ describe.each([
{
id: `none_${expectedShapeBpmnElementKind}_id`,
name: `none ${expectedShapeBpmnElementKind}`,
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: { eventDefinitionOn: EventDefinitionOn.NONE },
},
{
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: {
eventDefinitionKind: 'message',
eventDefinitionOn: EventDefinitionOn.EVENT,
withDifferentDefinition: true,
},
},
{
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: {
eventDefinitionKind: 'message',
eventDefinitionOn: EventDefinitionOn.DEFINITIONS,
withDifferentDefinition: true,
},
},
{
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: {
eventDefinitionKind: 'message',
eventDefinitionOn: EventDefinitionOn.BOTH,
Expand All @@ -79,7 +79,7 @@ describe.each([

...allDefinitionKinds.map((definitionKind, index) => ({
id: `${definitionKind}_${expectedShapeBpmnElementKind}_id_${index}`,
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: {
eventDefinitionKind: definitionKind,
eventDefinitionOn: EventDefinitionOn.EVENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import type { BuildEventDefinition, OtherBuildEventKind } from '../../../helpers/JsonBuilder';
import type { BuildEventDefinition, BuildNotBoundaryEventKind } from '../../../helpers/JsonBuilder';
import type { TEventDefinition } from '@lib/model/bpmn/json/baseElement/rootElement/eventDefinition';

import { EventDefinitionOn } from '../../../helpers/JsonBuilder';
Expand Down Expand Up @@ -67,7 +67,7 @@ describe.each([ShapeBpmnElementKind.EVENT_START, ShapeBpmnElementKind.EVENT_END,
];
describe.each(titlesForEventDefinitionIsAttributeOf)(`when %s`, (titleForEventDefinitionIsAttributeOf: string, eventDefinitionOn: EventDefinitionOn) => {
executeEventCommonTests(
{ bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent', eventDefinitionParameter: { eventDefinitionKind, eventDefinitionOn } },
{ bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind, eventDefinitionParameter: { eventDefinitionKind, eventDefinitionOn } },
{
bpmnElementKind: expectedShapeBpmnElementKind,
bpmnElementName: undefined,
Expand All @@ -86,7 +86,7 @@ describe.each([ShapeBpmnElementKind.EVENT_START, ShapeBpmnElementKind.EVENT_END,
(title: string, eventDefinition: string | TEventDefinition) => {
testMustConvertShapes(
{
bpmnKind: expectedShapeBpmnElementKind as OtherBuildEventKind | 'startEvent',
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
eventDefinitionParameter: { eventDefinitionKind, eventDefinitionOn, eventDefinition },
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

/** Internal model */
import type { BuildProcessParameter, BuildEventsParameter, OtherBuildEventKind } from '../../../helpers/JsonBuilder';
import type { BuildProcessParameter, BuildEventParameter, BuildNotBoundaryEventKind } from '../../../helpers/JsonBuilder';
import type { BpmnJsonModel } from '@lib/model/bpmn/json/bpmn20';

import { verifyEdge } from '../../../helpers/bpmn-model-expect';
Expand All @@ -35,7 +35,7 @@ function buildProcessParameter(kind: ShapeBpmnElementKind, id: string): BuildPro
return { id, withParticipant: true };
} else if (ShapeUtil.isEvent(kind)) {
const isBoundaryEvent = kind === ShapeBpmnElementKind.EVENT_BOUNDARY;
const eventParameter: BuildEventsParameter = isBoundaryEvent
const eventParameter: BuildEventParameter = isBoundaryEvent
? {
id,
bpmnKind: kind as 'boundaryEvent',
Expand All @@ -45,7 +45,7 @@ function buildProcessParameter(kind: ShapeBpmnElementKind, id: string): BuildPro
}
: {
id,
bpmnKind: kind as OtherBuildEventKind | 'startEvent',
bpmnKind: kind as BuildNotBoundaryEventKind,
eventDefinitionParameter: { eventDefinitionKind: 'message', eventDefinitionOn: EventDefinitionOn.EVENT },
};

Expand Down
Loading