Update tests
This commit is contained in:
@@ -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[hNovelNote].itemRoot == hTrashRoot # type: ignore
|
||||||
assert SHARED.project.tree[hSubNote].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()
|
# qtbot.stop()
|
||||||
|
|
||||||
# END Test testGuiProjTree_ContextMenu
|
# END Test testGuiProjTree_ContextMenu
|
||||||
|
|||||||
Reference in New Issue
Block a user