From 828a0b20324de08e31ab375c9dac7c2ea15ddbe2 Mon Sep 17 00:00:00 2001 From: Eugene Ghanizadeh Khoub Date: Sat, 25 Nov 2023 18:19:50 +0100 Subject: [PATCH] make codacy happy --- src/tests/unit/compat/v2/helper-test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tests/unit/compat/v2/helper-test.ts b/src/tests/unit/compat/v2/helper-test.ts index 26028dd3..7e79aa18 100644 --- a/src/tests/unit/compat/v2/helper-test.ts +++ b/src/tests/unit/compat/v2/helper-test.ts @@ -34,15 +34,15 @@ describe('test compat helpers for modifying diagrams.', () => { }); test('can find elements.', () => { - expect(findElement(model, class1Id)!.owner).toEqual(packageId); - expect(findElement(modelV2, class1Id)!.owner).toEqual(packageId); + expect(findElement(model, class1Id)?.owner).toEqual(packageId); + expect(findElement(modelV2, class1Id)?.owner).toEqual(packageId); expect(findElement(model, 'non-existing-id')).toBeUndefined(); expect(findElement(modelV2, 'non-existing-id')).toBeUndefined(); }); test('can find relationships.', () => { - expect(findRelationship(model, relId)!.source.element).toEqual(class2Id); - expect(findRelationship(modelV2, relId)!.target.element).toEqual(class1Id); + expect(findRelationship(model, relId)?.source.element).toEqual(class2Id); + expect(findRelationship(modelV2, relId)?.target.element).toEqual(class1Id); expect(findRelationship(model, 'non-existing-id')).toBeUndefined(); expect(findRelationship(modelV2, 'non-existing-id')).toBeUndefined(); });