From d12e626bc4a1bdfdfb7c3ad27083c5816d275038 Mon Sep 17 00:00:00 2001 From: Veronica Berglyd Olsen <1619840+vkbo@users.noreply.github.com> Date: Sun, 3 Mar 2024 21:17:18 +0100 Subject: [PATCH] Update tests --- tests/test_gui/test_gui_projtree.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_gui/test_gui_projtree.py b/tests/test_gui/test_gui_projtree.py index 18e41ea3..08a77861 100644 --- a/tests/test_gui/test_gui_projtree.py +++ b/tests/test_gui/test_gui_projtree.py @@ -1404,6 +1404,22 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, projPath, mockRnd): assert SHARED.project.tree[hNovelNote].itemRoot == hTrashRoot # type: ignore assert SHARED.project.tree[hSubNote].itemRoot == hTrashRoot # type: ignore + # Permanently Delete Menu + nwItem = SHARED.project.tree[hCharNote] + assert isinstance(nwItem, NWItem) + ctxMenu = _TreeContextMenu(projTree, nwItem) + ctxMenu.buildMultiSelectMenu([hCharNote, hNovelNote, hSubNote]) + actions = [x.text() for x in ctxMenu.actions() if x.text()] + assert actions == [ + "Set Active to ...", "Set Importance to ...", "Delete Permanently", + ] + + # Permanently Delete + ctxMenu._iterPermDelete() + assert SHARED.project.tree[hCharNote] is None + assert SHARED.project.tree[hNovelNote] is None + assert SHARED.project.tree[hSubNote] is None + # qtbot.stop() # END Test testGuiProjTree_ContextMenu