Update tests

This commit is contained in:
Veronica Berglyd Olsen
2024-02-10 15:49:49 +01:00
parent 9c1bdef9ad
commit c3e6b4e10a
3 changed files with 30 additions and 3 deletions
+19
View File
@@ -579,6 +579,11 @@ def testGuiEditor_Actions(qtbot, nwGUI, projPath, ipsumText, mockRnd):
assert nwGUI.docEditor.docAction(nwDocAction.BLOCK_COM) is True
assert nwGUI.docEditor.getText() == "#### Scene Title\n\n% Scene text.\n\n"
# Ignore Text
nwGUI.docEditor.setCursorPosition(20)
assert nwGUI.docEditor.docAction(nwDocAction.BLOCK_IGN) is True
assert nwGUI.docEditor.getText() == "#### Scene Title\n\n%~ Scene text.\n\n"
# Text
nwGUI.docEditor.setCursorPosition(20)
assert nwGUI.docEditor.docAction(nwDocAction.BLOCK_TXT) is True
@@ -1202,6 +1207,20 @@ def testGuiEditor_BlockFormatting(qtbot, monkeypatch, nwGUI, projPath, ipsumText
assert nwGUI.docEditor.getText() == "Some text\n\n"
assert nwGUI.docEditor.getCursorPosition() == 4
# Toggle Ignore Text w/Space
nwGUI.docEditor.replaceText("%~ Some text\n\n")
nwGUI.docEditor.setCursorPosition(5)
assert nwGUI.docEditor._formatBlock(nwDocAction.BLOCK_IGN) is True
assert nwGUI.docEditor.getText() == "Some text\n\n"
assert nwGUI.docEditor.getCursorPosition() == 2
# Toggle Ignore Text wo/Space
nwGUI.docEditor.replaceText("%~Some text\n\n")
nwGUI.docEditor.setCursorPosition(5)
assert nwGUI.docEditor._formatBlock(nwDocAction.BLOCK_IGN) is True
assert nwGUI.docEditor.getText() == "Some text\n\n"
assert nwGUI.docEditor.getCursorPosition() == 3
# Header 1
nwGUI.docEditor.replaceText("Some text\n\n")
nwGUI.docEditor.setCursorPosition(5)