From 2ff9baa394994ca4d0293083eba90432e3fcc5bd Mon Sep 17 00:00:00 2001 From: huyenngn Date: Mon, 17 Jun 2024 14:40:20 +0200 Subject: [PATCH] fix: Fix broken edges issues --- capellambse_context_diagrams/serializers.py | 1 + tests/test_context_diagrams.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/capellambse_context_diagrams/serializers.py b/capellambse_context_diagrams/serializers.py index 0bb5aae2..a5f9c806 100644 --- a/capellambse_context_diagrams/serializers.py +++ b/capellambse_context_diagrams/serializers.py @@ -93,6 +93,7 @@ def make_diagram( self.diagram.calculate_viewport() self.order_children() + self._edges.clear() return self.diagram def deserialize_child( diff --git a/tests/test_context_diagrams.py b/tests/test_context_diagrams.py index 3a722030..35be1bde 100644 --- a/tests/test_context_diagrams.py +++ b/tests/test_context_diagrams.py @@ -52,6 +52,7 @@ "c78b5d7c-be0c-4ed4-9d12-d447cb39304e", id="PhysicalBehaviorComponent", ), + pytest.param("957c5799-1d4a-4ac0-b5de-33a65bf1519c", id="Hey"), ], ) def test_context_diagrams(model: capellambse.MelodyModel, uuid: str) -> None: @@ -59,6 +60,9 @@ def test_context_diagrams(model: capellambse.MelodyModel, uuid: str) -> None: diag = obj.context_diagram + diag.render("svgdiagram", display_parent_relation=True) + diag.render("svgdiagram", display_parent_relation=False) + assert diag.nodes