Add menu entry and update tests
This commit is contained in:
@@ -327,12 +327,14 @@ def testBuildSettings_Headings(qtbot: QtBot, nwGUI: GuiMain):
|
||||
chTitle = f"Chapter: {nwHeadFmt.TITLE}"
|
||||
unTitle = f"Interlude: {nwHeadFmt.TITLE}"
|
||||
scTitle = f"Scene: {nwHeadFmt.TITLE}"
|
||||
shTitle = f"Hard Scene: {nwHeadFmt.TITLE}"
|
||||
sxTitle = f"Section: {nwHeadFmt.TITLE}"
|
||||
|
||||
build.setValue("headings.fmtTitle", ttTitle)
|
||||
build.setValue("headings.fmtChapter", chTitle)
|
||||
build.setValue("headings.fmtUnnumbered", unTitle)
|
||||
build.setValue("headings.fmtScene", scTitle)
|
||||
build.setValue("headings.fmtHardScene", shTitle)
|
||||
build.setValue("headings.fmtSection", sxTitle)
|
||||
build.setValue("headings.hideScene", False)
|
||||
build.setValue("headings.hideSection", False)
|
||||
@@ -351,6 +353,7 @@ def testBuildSettings_Headings(qtbot: QtBot, nwGUI: GuiMain):
|
||||
assert headTab.fmtChapter.text() == chTitle
|
||||
assert headTab.fmtUnnumbered.text() == unTitle
|
||||
assert headTab.fmtScene.text() == scTitle
|
||||
assert headTab.fmtHScene.text() == shTitle
|
||||
assert headTab.fmtSection.text() == sxTitle
|
||||
assert headTab.swtScene.isChecked() is False
|
||||
assert headTab.swtSection.isChecked() is False
|
||||
@@ -396,6 +399,14 @@ def testBuildSettings_Headings(qtbot: QtBot, nwGUI: GuiMain):
|
||||
headTab.btnApply.click()
|
||||
assert headTab.editTextBox.isEnabled() is False
|
||||
|
||||
# Hard Scene
|
||||
headTab.btnHScene.click()
|
||||
assert headTab._editing == headTab.EDIT_HSCENE
|
||||
assert headTab.editTextBox.isEnabled() is True
|
||||
assert headTab.editTextBox.toPlainText() == shTitle
|
||||
headTab.btnApply.click()
|
||||
assert headTab.editTextBox.isEnabled() is False
|
||||
|
||||
# Section
|
||||
headTab.btnSection.click()
|
||||
assert headTab._editing == headTab.EDIT_SECTION
|
||||
@@ -455,6 +466,11 @@ def testBuildSettings_Headings(qtbot: QtBot, nwGUI: GuiMain):
|
||||
headTab.btnApply.click()
|
||||
assert build.getStr("headings.fmtScene") == nwHeadFmt.TITLE
|
||||
|
||||
headTab.btnHScene.click()
|
||||
headTab.editTextBox.setPlainText(nwHeadFmt.TITLE)
|
||||
headTab.btnApply.click()
|
||||
assert build.getStr("headings.fmtHardScene") == nwHeadFmt.TITLE
|
||||
|
||||
headTab.btnSection.click()
|
||||
headTab.editTextBox.setPlainText(nwHeadFmt.TITLE)
|
||||
headTab.btnApply.click()
|
||||
|
||||
Reference in New Issue
Block a user