Skip to content

Commit

Permalink
fix renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
csouchet committed Sep 28, 2023
1 parent 14714a0 commit 3698f33
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
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 @@ -84,7 +84,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
8 changes: 4 additions & 4 deletions test/unit/helpers/TestUtils.BpmnJsonParser.event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
*/

import type { ExpectedBoundaryEventShape, ExpectedEventShape, ExpectedShape } from './bpmn-model-expect';
import type { BuildEventDefinition,BuildEventsParameter } from './JsonBuilder';
import type { BuildEventDefinition, BuildEventParameter } from './JsonBuilder';

import { verifyShape } from './bpmn-model-expect';
import { buildDefinitions, EventDefinitionOn } from './JsonBuilder';
Expand All @@ -33,7 +33,7 @@ export type OmitExpectedEventShape = Omit<ExpectedEventShape, 'shapeId' | 'bpmnE

export const expectedBounds = { x: 362, y: 232, width: 36, height: 45 };

export function testMustConvertShapes(buildEventParameter: BuildEventsParameter | BuildEventsParameter[], omitExpectedShape: OmitExpectedEventShape, processIsArray = false): void {
export function testMustConvertShapes(buildEventParameter: BuildEventParameter | BuildEventParameter[], omitExpectedShape: OmitExpectedEventShape, processIsArray = false): void {
const process = { event: buildEventParameter, task: {} };
const json = buildDefinitions({ process: processIsArray ? [process] : process });

Expand All @@ -51,7 +51,7 @@ export function testMustConvertShapes(buildEventParameter: BuildEventsParameter
}
}

export function testMustNotConvertEvent(buildEventParameter: BuildEventsParameter): void {
export function testMustNotConvertEvent(buildEventParameter: BuildEventParameter): void {
const json = buildDefinitions({ process: { event: buildEventParameter, task: {} } });

const bpmnModel = parseJsonAndExpectOnlyFlowNodes(json, 1, 1);
Expand All @@ -62,7 +62,7 @@ export function testMustNotConvertEvent(buildEventParameter: BuildEventsParamete
expect(warning.bpmnElementId).toBe('event_id_0_0');
}

export function executeEventCommonTests(buildEventParameter: BuildEventsParameter, omitExpectedShape: OmitExpectedEventShape, titleSuffix: string): void {
export function executeEventCommonTests(buildEventParameter: BuildEventParameter, omitExpectedShape: OmitExpectedEventShape, titleSuffix: string): void {
it.each([
['object', 'object'],
['object', 'array'],
Expand Down

0 comments on commit 3698f33

Please sign in to comment.