Add notes toggle test coverage

This commit is contained in:
Veronica Berglyd Olsen
2025-06-19 21:35:39 +02:00
parent 0d94a84724
commit 8d2551e0b6
+8 -2
View File
@@ -223,17 +223,23 @@ def testGuiViewer_Main(qtbot, monkeypatch, nwGUI, prjLipsum):
CONFIG.showFullPath = True
# Document footer show/hide synopsis
assert nwGUI.viewDocument("f96ec11c6a3da") is True
nwGUI.viewDocument("f96ec11c6a3da")
assert len(docViewer.toPlainText()) == 4314
docViewer.docFooter._doToggleSynopsis(False)
assert len(docViewer.toPlainText()) == 4098
# Document footer show/hide comments
assert nwGUI.viewDocument("846352075de7d") is True
nwGUI.viewDocument("846352075de7d")
assert len(docViewer.toPlainText()) == 683
docViewer.docFooter._doToggleComments(False)
assert len(docViewer.toPlainText()) == 634
# Document footer show/hide notes
nwGUI.viewDocument("88d59a277361b")
assert len(docViewer.toPlainText()) == 900
docViewer.docFooter._doToggleNotes(False)
assert len(docViewer.toPlainText()) == 871
# Crash the HTML rendering
with monkeypatch.context() as mp:
mp.setattr(ToQTextDocument, "doConvert", causeException)