Skip to content

Add test for showInteractiveDialogue's no-options fallback - #137

Merged
dmccoystephenson merged 1 commit into
mainfrom
feature/test-base-ui-empty-dialogue-options
Aug 1, 2026
Merged

Add test for showInteractiveDialogue's no-options fallback#137
dmccoystephenson merged 1 commit into
mainfrom
feature/test-base-ui-empty-dialogue-options

Conversation

@dmccoystephenson

Copy link
Copy Markdown
Member

Summary

  • Full-repo triage this cycle found no open issues/PRs and no drift: schemas match their models and *JsonReaderWriters, README/PLANNING.md/Dockerfile/requirements.txt/install scripts all match actual behavior, money/price displays are correctly %.2f (or legitimately always-integer, using %d), no test relies on unseeded random, and no test hits a real filesystem/display.
  • Coverage review (pytest --cov=src) showed src/ui/baseUserInterface.py at 82%, the lowest of any module. The uncovered non-abstract lines were showInteractiveDialogue's fallback branch for an NPC with zero currently-available dialogue options (e.g. every option's condition is false) — this is shared logic both the pygame and web front-ends inherit without override, so it's real production behavior, just never exercised by a test.
  • Added test_inherited_interactive_dialogue_falls_back_to_introduction_when_no_options, characterizing the current (correct) behavior: the NPC's introduce() text is shown via showDialogue instead of an empty question menu.

Per the entire-untouched-backlog note: there was no backlog to defer — zero open issues and zero open PRs at triage time, and no functional bugs were found during the review, so this cycle's only outcome is the test-expansion work above (Phase 2 Stage B).

Test plan

  • python3 -m compileall -q src
  • Full suite (pytest, headless SDL) — 464 passed, up from 463
  • Coverage on src/ui/baseUserInterface.py rose from 82% → 88%; all remaining uncovered lines are unreachable @abstractmethod pass stub bodies

BaseUserInterface.showInteractiveDialogue's branch for an NPC with zero
currently-available dialogue options (e.g. every option's condition is
false) was untested, despite being shared logic the pygame and web
front-ends both inherit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric:

  • Scope: PASS — only tests/ui/test_baseUserInterface.py is touched; this is a pure test-expansion (Stage B) cycle, no production code changed.
  • Tests-new: PASS — test_inherited_interactive_dialogue_falls_back_to_introduction_when_no_options exercises BaseUserInterface.showInteractiveDialogue's previously-untested "zero available dialogue options" branch (baseUserInterface.py:119-122).
  • Tests-fix: N/A — this cycle adds characterization coverage, not a bug fix; no production code was changed so there's nothing to stash-and-revert.
  • Sibling structure: PASS — follows the # prepare/# call/# check comment convention and the existing FakeNPC/ConditionalNPC fixture-class pattern already used in this file; the new NoOptionsNPC fixture mirrors them.
  • Sibling renames: N/A — no renames in this diff.
  • Docs: PASS — no persisted fields or user-facing behavior changed; nothing in the Phase 7 doc sources needs updating.
  • Issue resolution: N/A — no open issues existed at triage time (Phase 1 found zero open issues, zero open PRs), so there is no Closes #N and no backlog was deferred.
  • CI: PASS — green on the PR head SHA (gh pr checks 137 --watch).

Repo-specific:

  • Schema-sync: N/A — no persisted field changes.
  • Money-format: N/A — no money/price display touched.
  • Deterministic-tests: PASS — no random usage in the new test.
  • Headless-pygame: N/A — baseUserInterface.py has no pygame dependency (that's pygameUserInterface.py).
  • camelCase: PASS — new test/class naming matches this file's existing conventions (test_snake_case functions per pytest convention already used throughout, PascalCase fixture classes, get_dialogue_options/introduce method names matching the real NPC/BaseUserInterface interface signatures).

Coverage on src/ui/baseUserInterface.py rose from 82% → 88% (pytest --cov=src); all remaining uncovered lines are unreachable @abstractmethod pass stub bodies, which can never execute directly. Full suite: 464 passed (up from 463), 0 failed.

No open issues or PRs existed at Phase 1 triage, so no backlog was deferred this cycle.

@dmccoystephenson
dmccoystephenson merged commit ccb6b42 into main Aug 1, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feature/test-base-ui-empty-dialogue-options branch August 1, 2026 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant