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] Simplify imports of expected model elements #2067

Merged
merged 2 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion test/unit/component/mxgraph/renderer/StyleComputer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import {
ShapeBpmnSubProcessKind,
} from '../../../../../src/bpmn-visualization';
import Label, { Font } from '../../../../../src/model/bpmn/internal/Label';
import type { ExpectedFont } from '../../parser/json/JsonTestUtils';
import { Edge } from '../../../../../src/model/bpmn/internal/edge/edge';
import { AssociationFlow, MessageFlow, SequenceFlow } from '../../../../../src/model/bpmn/internal/edge/flows';
import Bounds from '../../../../../src/model/bpmn/internal/Bounds';
import type { ExpectedFont } from '../../../helpers/bpmn-model-expect';

function toFont(font: ExpectedFont): Font {
return new Font(font.name, font.size, font.isBold, font.isItalic, font.isUnderline, font.isStrikeThrough);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyEdges, verifyEdge } from './JsonTestUtils';

import { parseJsonAndExpectOnlyEdges } from './JsonTestUtils';
import { verifyEdge } from '../../../helpers/bpmn-model-expect';
import { Waypoint } from '../../../../../src/model/bpmn/internal/edge/edge';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyFlowNodes, verifyShape } from './JsonTestUtils';

import { parseJsonAndExpectOnlyFlowNodes } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import type { TCallActivity } from '../../../../../src/model/bpmn/json/baseElement/flowNode/activity/activity';
import type { GlobalTaskKind } from '../../../../../src/model/bpmn/internal';
import { ShapeBpmnCallActivityKind, ShapeBpmnElementKind, ShapeBpmnMarkerKind } from '../../../../../src/model/bpmn/internal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyFlowNodes, verifyShape } from './JsonTestUtils';

import { parseJsonAndExpectOnlyFlowNodes } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/internal';
import type { BpmnJsonModel } from '../../../../../src/model/bpmn/json/BPMN20';

Expand Down
4 changes: 3 additions & 1 deletion test/unit/component/parser/json/BpmnJsonParser.event.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { expectAsWarning, parseJsonAndExpectEvent, parseJsonAndExpectOnlyFlowNodes, parsingMessageCollector, verifyShape } from './JsonTestUtils';

import { expectAsWarning, parseJsonAndExpectEvent, parseJsonAndExpectOnlyFlowNodes, parsingMessageCollector } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';
import type { TEventDefinition } from '../../../../../src/model/bpmn/json/baseElement/rootElement/eventDefinition';
import type { TCatchEvent, TThrowEvent } from '../../../../../src/model/bpmn/json/baseElement/flowNode/event';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyFlowNodes, verifyShape } from './JsonTestUtils';

import { parseJsonAndExpectOnlyFlowNodes } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';
import { ShapeBpmnElementKind, ShapeBpmnEventBasedGatewayKind } from '../../../../../src/model/bpmn/internal';
import type { ShapeBpmnEventBasedGateway } from '../../../../../src/model/bpmn/internal/shape/ShapeBpmnElement';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import {
parseJsonAndExpectOnlyPoolsAndFlowNodes,
parseJsonAndExpectOnlyWarnings,
parsingMessageCollector,
verifyShape,
} from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/internal';
import { GroupUnknownCategoryValueWarning, ShapeUnknownBpmnElementWarning } from '../../../../../src/component/parser/json/warnings';

Expand Down
4 changes: 3 additions & 1 deletion test/unit/component/parser/json/BpmnJsonParser.lane.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { expectAsWarning, parseJson, parseJsonAndExpectOnlyLanes, parsingMessageCollector } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/internal';
import { expectAsWarning, parseJson, parseJsonAndExpectOnlyLanes, parsingMessageCollector, verifyShape } from './JsonTestUtils';
import { LaneUnknownFlowNodeRefWarning } from '../../../../../src/component/parser/json/warnings';

describe('parse bpmn as json for lane', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyFlowNodes, verifyShape } from './JsonTestUtils';

import { parseJsonAndExpectOnlyFlowNodes } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';
import type { TMultiInstanceLoopCharacteristics, TStandardLoopCharacteristics } from '../../../../../src/model/bpmn/json/baseElement/loopCharacteristics';
import { ShapeBpmnCallActivityKind, ShapeBpmnElementKind, ShapeBpmnMarkerKind } from '../../../../../src/model/bpmn/internal';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyEdges, verifyEdge } from './JsonTestUtils';

import { parseJsonAndExpectOnlyEdges } from './JsonTestUtils';
import { verifyEdge } from '../../../helpers/bpmn-model-expect';
import { Waypoint } from '../../../../../src/model/bpmn/internal/edge/edge';
import { MessageVisibleKind } from '../../../../../src/model/bpmn/internal/edge/kinds';
import { MessageVisibleKind } from '../../../../../src/model/bpmn/internal';
import * as bpmndi from '../../../../../src/model/bpmn/json/BPMNDI';

describe('parse bpmn as json for message flow', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpect, parseJsonAndExpectOnlyPools, parseJsonAndExpectOnlyPoolsAndFlowNodes, parseJsonAndExpectOnlyPoolsAndLanes, verifyShape } from './JsonTestUtils';

import { parseJsonAndExpect, parseJsonAndExpectOnlyPools, parseJsonAndExpectOnlyPoolsAndFlowNodes, parseJsonAndExpectOnlyPoolsAndLanes } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/internal';
import type { BpmnJsonModel } from '../../../../../src/model/bpmn/json/BPMN20';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyEdgesAndFlowNodes, verifyEdge } from './JsonTestUtils';

import { parseJsonAndExpectOnlyEdgesAndFlowNodes } from './JsonTestUtils';
import { verifyEdge } from '../../../helpers/bpmn-model-expect';
import { SequenceFlowKind } from '../../../../../src/model/bpmn/internal';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';
import type { TSequenceFlow } from '../../../../../src/model/bpmn/json/baseElement/flowElement';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyEdgesAndFlowNodes, verifyEdge } from './JsonTestUtils';

import { parseJsonAndExpectOnlyEdgesAndFlowNodes } from './JsonTestUtils';
import { verifyEdge } from '../../../helpers/bpmn-model-expect';
import { SequenceFlowKind } from '../../../../../src/model/bpmn/internal';
import { Waypoint } from '../../../../../src/model/bpmn/internal/edge/edge';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyEdges, verifyEdge } from './JsonTestUtils';

import { parseJsonAndExpectOnlyEdges } from './JsonTestUtils';
import { verifyEdge } from '../../../helpers/bpmn-model-expect';
import { Waypoint } from '../../../../../src/model/bpmn/internal/edge/edge';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { ExpectedShape } from './JsonTestUtils';
import { parseJson, parseJsonAndExpectOnlySubProcess, verifyEdge, verifyShape, verifySubProcess } from './JsonTestUtils';

import { parseJson, parseJsonAndExpectOnlySubProcess, verifySubProcess } from './JsonTestUtils';
import { getEventShapes } from './TestUtils';
import type { ExpectedShape } from '../../../helpers/bpmn-model-expect';
import { verifyEdge, verifyShape } from '../../../helpers/bpmn-model-expect';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';
import type BpmnModel from '../../../../../src/model/bpmn/internal/BpmnModel';
import { ShapeBpmnElementKind, ShapeBpmnEventDefinitionKind, ShapeBpmnMarkerKind, ShapeBpmnSubProcessKind } from '../../../../../src/model/bpmn/internal';
import type { ShapeBpmnEvent } from '../../../../../src/model/bpmn/internal/shape/ShapeBpmnElement';
import type Shape from '../../../../../src/model/bpmn/internal/shape/Shape';
import { getEventShapes } from './TestUtils';

function expectNoPoolLane(model: BpmnModel): void {
expect(model.lanes).toHaveLength(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { parseJsonAndExpectOnlyFlowNodes, verifyShape } from './JsonTestUtils';

import { parseJsonAndExpectOnlyFlowNodes } from './JsonTestUtils';
import { verifyShape } from '../../../helpers/bpmn-model-expect';
import { ShapeBpmnElementKind } from '../../../../../src/model/bpmn/internal';
import type { TProcess } from '../../../../../src/model/bpmn/json/baseElement/rootElement/rootElement';

Expand Down
4 changes: 0 additions & 4 deletions test/unit/component/parser/json/JsonTestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ import type { JsonParsingWarning } from '../../../../../src/component/parser/par
import { ParsingMessageCollector } from '../../../../../src/component/parser/parsing-messages';
import type { ExpectedBounds, ExpectedFont } from '../../../helpers/bpmn-model-expect';

// This is a temporary solution after the verifyShape and verifyEdge functions moved to the 'bpmn-model-expect' file.
// It left the json parser tests imports untouched. The imports will be changed later.
export * from '../../../helpers/bpmn-model-expect';

class ParsingMessageCollectorTester extends ParsingMessageCollector {
private warnings: Array<JsonParsingWarning> = [];

Expand Down