Skip to content

Commit

Permalink
unit test: fix some tsc errors
Browse files Browse the repository at this point in the history
Mark unused param in test function. They must be kept as the parameter is used to generate the test title or because it
is required by the function signature.
  • Loading branch information
tbouffard committed Mar 7, 2024
1 parent 090b00c commit f2e84d9
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions test/unit/component/mxgraph/renderer/StyleComputer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ describe('Style Computer', () => {
describe.each([
['expanded', []],
['collapsed', [ShapeBpmnMarkerKind.EXPAND]],
])(`%s`, (expandKind: string, markers: ShapeBpmnMarkerKind[]) => {
])(`%s`, (_expandKind: string, markers: ShapeBpmnMarkerKind[]) => {
describe.each(Object.values(ShapeBpmnSubProcessKind))(`%s`, (subProcessKind: ShapeBpmnSubProcessKind) => {
markers = getExpectedMarkers(markers, subProcessKind);
const additionalMarkerStyle = markers.length > 0 ? `;bpmn.markers=${markers.join(',')}` : '';
Expand Down Expand Up @@ -361,7 +361,7 @@ describe('Style Computer', () => {
it.each([
['non-instantiating', false],
['instantiating', true],
])('%s receive task', (instantiatingKind: string, instantiate: boolean) => {
])('%s receive task', (_instantiatingKind: string, instantiate: boolean) => {
const shape = newShape(newShapeBpmnActivity(ShapeBpmnElementKind.TASK_RECEIVE, undefined, instantiate), newLabel({ name: 'Arial' }));
expect(computeStyle(shape)).toBe(`receiveTask;bpmn.isInstantiating=${instantiate};fontFamily=Arial`);
});
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('Style Computer', () => {
['vertical', false, '1'],
['horizontal', true, '0'],
['no isHorizontal value for a', undefined, '1'],
])('%s pool references a Process', (title: string, isHorizontal: boolean, expected: string) => {
])('%s pool references a Process', (_title: string, isHorizontal: boolean, expected: string) => {
const shape = newShape(newShapeBpmnElement(ShapeBpmnElementKind.POOL), undefined, isHorizontal);
expect(computeStyle(shape)).toBe(`pool;horizontal=${expected}`);
});
Expand All @@ -405,7 +405,7 @@ describe('Style Computer', () => {
['vertical', false, '1'],
['horizontal', true, '0'],
['no isHorizontal value for a', undefined, '1'],
])('%s lane', (title: string, isHorizontal: boolean, expected: string) => {
])('%s lane', (_title: string, isHorizontal: boolean, expected: string) => {
const shape = newShape(newShapeBpmnElement(ShapeBpmnElementKind.LANE), undefined, isHorizontal);
expect(computeStyle(shape)).toBe(`lane;horizontal=${expected}`);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('parse bpmn as json for association', () => {
['array', [processJsonAsObjectWithAssociationJsonAsObject]],
])(
`should convert as Edge, when an association is an attribute (as object) of 'process' (as %s)`,
(title: string, processParameter: BuildProcessParameter | BuildProcessParameter[]) => {
(_title: string, processParameter: BuildProcessParameter | BuildProcessParameter[]) => {
const json = buildDefinitions({ process: processParameter });

const model = parseJsonAndExpectOnlyEdges(json, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ describe('parse bpmn as json for callActivity', () => {
['array', [callActivityJson]],
])(
`should convert as Shape, when a process contains a ${expandedKind} call activity calling another existing process`,
(title, callActivity: BuildCallActivityParameter | BuildCallActivityParameter[]) => {
(_title, callActivity: BuildCallActivityParameter | BuildCallActivityParameter[]) => {
const json: BpmnJsonModel = buildDefinitions({
process: [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe.each([ShapeBpmnElementKind.EVENT_START, ShapeBpmnElementKind.EVENT_END,

it.each(eventDefinitionParameters)(
`should convert as Shape, when '${eventDefinitionKind}EventDefinition' is %s, ${titleForEventDefinitionIsAttributeOf}`,
(title: string, eventDefinition: string | TEventDefinition) => {
(_title: string, eventDefinition: string | TEventDefinition) => {
testMustConvertShapes(
{
bpmnKind: expectedShapeBpmnElementKind as BuildNotBoundaryEventKind,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe.each([
it.each([
['object', processWithFlowNodeAsObject],
['array', [processWithFlowNodeAsObject]],
])(`should convert as Shape, when a ${bpmnKind} is an attribute (as object) of 'process' (as %s)`, (title: string, processJson: TProcess | TProcess[]) => {
])(`should convert as Shape, when a ${bpmnKind} is an attribute (as object) of 'process' (as %s)`, (_title: string, processJson: TProcess | TProcess[]) => {
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
Expand Down
4 changes: 2 additions & 2 deletions test/unit/component/parser/json/BpmnJsonParser.marker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe.each([
])(
`should convert as Shape with ${expectedMarkerKind} marker, when '${bpmnLoopCharacteristicsKind}' is an attribute (as %s) of '${bpmnSemanticType}' and BPMNShape is expanded`,
(
title: string,
_title: string,
loopCharacteristics:
| string
| TStandardLoopCharacteristics
Expand Down Expand Up @@ -138,7 +138,7 @@ describe.each([
['array with object', [{ isSequential }]],
])(
`should convert as Shape with ${expectedMarkerKind} marker, when 'isSequential' is an attribute (as ${isSequential}) of 'multiInstanceLoopCharacteristics' (as %s) of '${bpmnSemanticType}' and BPMNShape is expanded`,
(title: string, loopCharacteristics: TMultiInstanceLoopCharacteristics | TMultiInstanceLoopCharacteristics[]) => {
(_title: string, loopCharacteristics: TMultiInstanceLoopCharacteristics | TMultiInstanceLoopCharacteristics[]) => {
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('parse bpmn as json for sequence flow', () => {
it.each([
['object', processWithSequenceFlowAsObject],
['array', [processWithSequenceFlowAsObject]],
])(`should convert as Edge, when a sequence flow is an attribute (as object) of 'process' (as %s)`, (title: string, processJson: TProcess | TProcess[]) => {
])(`should convert as Edge, when a sequence flow is an attribute (as object) of 'process' (as %s)`, (_title: string, processJson: TProcess | TProcess[]) => {
const json: BpmnJsonModel = {
definitions: {
targetNamespace: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('parse bpmn as json for sub-process', () => {
['array', [processWithSubProcessAsObject]],
])(
`should convert as Shape, when a ${expandedKind} ${expectedShapeBpmnSubProcessKind} sub-process is an attribute (as object) of 'process' (as %s)`,
(title: string, processParameter: BuildProcessParameter | BuildProcessParameter[]) => {
(_title: string, processParameter: BuildProcessParameter | BuildProcessParameter[]) => {
const json = buildDefinitions({ process: processParameter });

const model = parseJsonAndExpectOnlySubProcess(json, expectedShapeBpmnSubProcessKind, 1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe('parse bpmn as json for text annotation', () => {
['array', [processWithArtifactAsObject]],
])(
`should convert as Shape, when a text annotation is an attribute (as object) of 'process' (as %s)`,
(title: string, processParameter: BuildProcessParameter | BuildProcessParameter[]) => {
(_title: string, processParameter: BuildProcessParameter | BuildProcessParameter[]) => {
const json = buildDefinitions({ process: processParameter });

const model = parseJsonAndExpectOnlyFlowNodes(json, 1);
Expand Down
2 changes: 1 addition & 1 deletion test/unit/helpers/TestUtils.BpmnJsonParser.event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function executeEventCommonTests(buildEventParameter: BuildEventParameter
it.each([
["'name'", 'event name'],
["no 'name'", undefined],
])(`should convert as Shape, when '${buildEventParameter.bpmnKind}' has %s, ${titleSuffix}`, (title: string, eventName: string) => {
])(`should convert as Shape, when '${buildEventParameter.bpmnKind}' has %s, ${titleSuffix}`, (_title: string, eventName: string) => {
testMustConvertShapes({ ...buildEventParameter, name: eventName }, { ...omitExpectedShape, bpmnElementName: eventName });
});

Expand Down

0 comments on commit f2e84d9

Please sign in to comment.