Fix test, again ...
This commit is contained in:
@@ -1182,7 +1182,7 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
|||||||
ctxMenu.buildSingleSelectMenu(True)
|
ctxMenu.buildSingleSelectMenu(True)
|
||||||
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
||||||
assert actions == [
|
assert actions == [
|
||||||
"Create New", "Rename", "Set Status to ...", "Expand All",
|
"Create New ...", "Rename", "Set Status to ...", "Expand All",
|
||||||
"Collapse All", "Duplicate from Here", "Delete Permanently",
|
"Collapse All", "Duplicate from Here", "Delete Permanently",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1193,13 +1193,13 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
|||||||
ctxMenu.buildSingleSelectMenu(True)
|
ctxMenu.buildSingleSelectMenu(True)
|
||||||
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
||||||
assert actions == [
|
assert actions == [
|
||||||
"Create New", "Rename", "Set Status to ...", "Transform", "Expand All",
|
"Create New ...", "Rename", "Set Status to ...", "Transform ...", "Expand All",
|
||||||
"Collapse All", "Duplicate from Here", "Move to Trash",
|
"Collapse All", "Duplicate from Here", "Move to Trash",
|
||||||
]
|
]
|
||||||
|
|
||||||
def getTransformSubMenu(menu: QMenu) -> list[str]:
|
def getTransformSubMenu(menu: QMenu) -> list[str]:
|
||||||
for action in menu.actions():
|
for action in menu.actions():
|
||||||
if action.text() == "Transform":
|
if action.text() == "Transform ...":
|
||||||
return [x.text() for x in action.menu().actions() if x.text()]
|
return [x.text() for x in action.menu().actions() if x.text()]
|
||||||
return []
|
return []
|
||||||
|
|
||||||
@@ -1210,8 +1210,8 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
|||||||
ctxMenu.buildSingleSelectMenu(True)
|
ctxMenu.buildSingleSelectMenu(True)
|
||||||
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
||||||
assert actions == [
|
assert actions == [
|
||||||
"Open Document", "View Document", "Create New", "Rename", "Toggle Active",
|
"Open Document", "View Document", "Create New ...", "Rename", "Toggle Active",
|
||||||
"Set Status to ...", "Transform", "Expand All", "Collapse All",
|
"Set Status to ...", "Transform ...", "Expand All", "Collapse All",
|
||||||
"Duplicate from Here", "Move to Trash",
|
"Duplicate from Here", "Move to Trash",
|
||||||
]
|
]
|
||||||
assert getTransformSubMenu(ctxMenu) == [
|
assert getTransformSubMenu(ctxMenu) == [
|
||||||
@@ -1226,8 +1226,8 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
|||||||
ctxMenu.buildSingleSelectMenu(False)
|
ctxMenu.buildSingleSelectMenu(False)
|
||||||
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
||||||
assert actions == [
|
assert actions == [
|
||||||
"Open Document", "View Document", "Create New", "Rename", "Toggle Active",
|
"Open Document", "View Document", "Create New ...", "Rename", "Toggle Active",
|
||||||
"Set Importance to ...", "Transform", "Duplicate Document", "Move to Trash",
|
"Set Importance to ...", "Transform ...", "Duplicate Document", "Move to Trash",
|
||||||
]
|
]
|
||||||
assert getTransformSubMenu(ctxMenu) == [
|
assert getTransformSubMenu(ctxMenu) == [
|
||||||
"Split Document by Headers",
|
"Split Document by Headers",
|
||||||
@@ -1240,8 +1240,8 @@ def testGuiProjTree_ContextMenu(qtbot, monkeypatch, nwGUI, projPath, mockRnd):
|
|||||||
ctxMenu.buildSingleSelectMenu(False)
|
ctxMenu.buildSingleSelectMenu(False)
|
||||||
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
actions = [x.text() for x in ctxMenu.actions() if x.text()]
|
||||||
assert actions == [
|
assert actions == [
|
||||||
"Open Document", "View Document", "Create New", "Rename", "Toggle Active",
|
"Open Document", "View Document", "Create New ...", "Rename", "Toggle Active",
|
||||||
"Set Status to ...", "Transform", "Duplicate Document", "Move to Trash",
|
"Set Status to ...", "Transform ...", "Duplicate Document", "Move to Trash",
|
||||||
]
|
]
|
||||||
assert getTransformSubMenu(ctxMenu) == [
|
assert getTransformSubMenu(ctxMenu) == [
|
||||||
"Convert to Novel Document", "Split Document by Headers",
|
"Convert to Novel Document", "Split Document by Headers",
|
||||||
|
|||||||
Reference in New Issue
Block a user