Update tests

This commit is contained in:
Veronica Berglyd Olsen
2022-06-12 17:54:37 +02:00
parent 52683d5a21
commit 88b2d61cec
12 changed files with 31 additions and 11 deletions
+1 -1
View File
@@ -132,7 +132,7 @@ def testGuiMain_ProjectTreeItems(qtbot, monkeypatch, nwGUI, fncProj, mockRnd):
# Novel Tree has focus
nwGUI.projStack.setCurrentIndex(1)
nwGUI.novelView.refreshTree(True)
nwGUI.novelView.refreshTree(rootHandle=None, overRide=True)
with monkeypatch.context() as mp:
mp.setattr(GuiNovelView, "treeFocus", lambda *a: True)
assert nwGUI.docEditor.docHandle() is None
+2 -2
View File
@@ -62,7 +62,7 @@ def testGuiNovelTree_TreeItems(qtbot, monkeypatch, nwGUI, nwMinimal):
nwGUI.projStack.setCurrentIndex(nwGUI.idxNovelView)
nwGUI.rebuildIndex()
novelTree._populateTree()
novelTree._populateTree(rootHandle=None)
assert novelTree.topLevelItemCount() == 1
# Rebuild should preserve selection
@@ -133,7 +133,7 @@ def testGuiNovelTree_TreeItems(qtbot, monkeypatch, nwGUI, nwMinimal):
"#### Section\n\n"
))
nwGUI.rebuildIndex()
novelTree._populateTree()
novelTree._populateTree(None)
assert novelTree.topLevelItem(0).text(novelTree.C_TITLE) == "Section wo/Scene"
assert novelTree.topLevelItem(1).text(novelTree.C_TITLE) == "Scene wo/Chapter"
assert novelTree.topLevelItem(2).text(novelTree.C_TITLE) == "Chapter wo/Title"