From f830824a9db2faa969dbf5f51a4a5e615eb27ca7 Mon Sep 17 00:00:00 2001
From: Oscar Gustafsson <oscar.gustafsson@gmail.com>
Date: Wed, 25 Jan 2023 16:55:00 +0100
Subject: [PATCH] Another test

---
 test/test_gui.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/test_gui.py b/test/test_gui.py
index 3e15726f..301aacd7 100644
--- a/test/test_gui.py
+++ b/test/test_gui.py
@@ -56,6 +56,23 @@ def test_sfg_invalidated_by_remove_of_operation(qtbot, datadir):
     widget.exit_app()
 
 
+def test_sfg_invalidated_by_deleting_of_operation(qtbot, datadir):
+    widget = GUI.MainWindow()
+    qtbot.addWidget(widget)
+    widget._load_from_file(datadir.join('twotapfir.py'))
+    sfg = widget.sfg_dict['twotapfir']
+    ops_before_remove = len(widget.operationDragDict)
+    op = sfg.find_by_name("cmul2")
+    dragbutton = widget.operationDragDict[op[0]]
+    # Click
+    qtbot.mouseClick(dragbutton, QtCore.Qt.MouseButton.LeftButton)
+    qtbot.keyClick(widget, QtCore.Qt.Key.Key_Delete)
+    assert not widget.sfg_dict
+    assert ops_before_remove - 1 == len(widget.operationDragDict)
+
+    widget.exit_app()
+
+
 def test_select_operation(qtbot, datadir):
     widget = GUI.MainWindow()
     qtbot.addWidget(widget)
-- 
GitLab