Merge branch 'main' into dev
This commit is contained in:
@@ -432,21 +432,21 @@ def testGuiEditor_Actions(qtbot, nwGUI, projPath, ipsumText, mockRnd):
|
||||
|
||||
# Emphasis
|
||||
nwGUI.docEditor.setCursorPosition(50)
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.EMPH) is True
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.MD_ITALIC) is True
|
||||
assert nwGUI.docEditor.getText() == text.replace("consectetur", "_consectetur_")
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.UNDO) is True
|
||||
assert nwGUI.docEditor.getText() == text
|
||||
|
||||
# Strong
|
||||
nwGUI.docEditor.setCursorPosition(50)
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.STRONG) is True
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.MD_BOLD) is True
|
||||
assert nwGUI.docEditor.getText() == text.replace("consectetur", "**consectetur**")
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.UNDO) is True
|
||||
assert nwGUI.docEditor.getText() == text
|
||||
|
||||
# Strikeout
|
||||
nwGUI.docEditor.setCursorPosition(50)
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.STRIKE) is True
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.MD_STRIKE) is True
|
||||
assert nwGUI.docEditor.getText() == text.replace("consectetur", "~~consectetur~~")
|
||||
assert nwGUI.docEditor.docAction(nwDocAction.UNDO) is True
|
||||
assert nwGUI.docEditor.getText() == text
|
||||
@@ -667,27 +667,26 @@ def testGuiEditor_ToolBar(qtbot, nwGUI, projPath, mockRnd):
|
||||
docEditor._toggleToolBarVisibility()
|
||||
assert docToolBar.isVisible() is True
|
||||
|
||||
# Markdown Mode
|
||||
assert docToolBar.tbMode.isChecked() is False
|
||||
# Markdown
|
||||
# ========
|
||||
|
||||
# Click Bold
|
||||
docEditor.setCursorPosition(20)
|
||||
docToolBar.tbBold.click()
|
||||
docToolBar.tbBoldMD.click()
|
||||
assert len(docEditor.getText()) == length + 4
|
||||
|
||||
# Click Italic
|
||||
docEditor.setCursorPosition(54)
|
||||
docToolBar.tbItalic.click()
|
||||
docToolBar.tbItalicMD.click()
|
||||
assert len(docEditor.getText()) == length + 6
|
||||
|
||||
# Click Strikethrough
|
||||
docEditor.setCursorPosition(90)
|
||||
docToolBar.tbStrike.click()
|
||||
docToolBar.tbStrikeMD.click()
|
||||
assert len(docEditor.getText()) == length + 10
|
||||
|
||||
# Shortcode Mode
|
||||
docToolBar.tbMode.click()
|
||||
assert docToolBar.tbMode.isChecked() is True
|
||||
# Shortcodes
|
||||
# ==========
|
||||
|
||||
# Click Bold
|
||||
docEditor.setCursorPosition(39)
|
||||
|
||||
@@ -50,17 +50,17 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
cleanText = nwGUI.docEditor.getText()[39:86]
|
||||
|
||||
# Bold
|
||||
nwGUI.mainMenu.aFmtStrong.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtBold.activate(QAction.Trigger)
|
||||
fmtStr = "**Pellentesque** nec erat ut nulla posuere commodo."
|
||||
assert nwGUI.docEditor.getText()[39:90] == fmtStr
|
||||
nwGUI.mainMenu.aFmtStrong.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtBold.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText()[39:86] == cleanText
|
||||
|
||||
# Italic
|
||||
nwGUI.mainMenu.aFmtEmph.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtItalic.activate(QAction.Trigger)
|
||||
fmtStr = "_Pellentesque_ nec erat ut nulla posuere commodo."
|
||||
assert nwGUI.docEditor.getText()[39:88] == fmtStr
|
||||
nwGUI.mainMenu.aFmtEmph.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtItalic.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText()[39:86] == cleanText
|
||||
|
||||
# Strikethrough
|
||||
@@ -71,10 +71,10 @@ def testGuiMenu_EditFormat(qtbot, monkeypatch, nwGUI, prjLipsum):
|
||||
assert nwGUI.docEditor.getText()[39:86] == cleanText
|
||||
|
||||
# Should get us back to plain
|
||||
nwGUI.mainMenu.aFmtStrong.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtEmph.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtEmph.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtStrong.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtBold.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtItalic.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtItalic.activate(QAction.Trigger)
|
||||
nwGUI.mainMenu.aFmtBold.activate(QAction.Trigger)
|
||||
assert nwGUI.docEditor.getText()[39:86] == cleanText
|
||||
|
||||
# Double Quotes
|
||||
|
||||
Reference in New Issue
Block a user