Improve how items are added to project tree, allowing root folders to be added next to specified items
This commit is contained in:
@@ -37,8 +37,7 @@ from novelwriter.dialogs.editlabel import GuiEditLabel
|
||||
|
||||
@pytest.mark.gui
|
||||
def testGuiProjTree_NewItems(qtbot, caplog, monkeypatch, nwGUI, projPath, mockRnd):
|
||||
"""Test adding and removing items from the project tree.
|
||||
"""
|
||||
"""Test adding and removing items from the project tree."""
|
||||
monkeypatch.setattr(GuiEditLabel, "getLabel", lambda *a, text: (text, True))
|
||||
|
||||
projView = nwGUI.projView
|
||||
@@ -159,6 +158,9 @@ def testGuiProjTree_NewItems(qtbot, caplog, monkeypatch, nwGUI, projPath, mockRn
|
||||
nHandle = theProject.newFile("Test", None)
|
||||
assert projView.projTree.revealNewTreeItem(nHandle) is False
|
||||
|
||||
# Adding an invalid item directly to the tree should also fail
|
||||
assert projView.projTree._addTreeItem(None) is None
|
||||
|
||||
# Clean up
|
||||
# qtbot.stop()
|
||||
nwGUI.closeProject()
|
||||
|
||||
Reference in New Issue
Block a user