mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Tests: catch up stale assertions to current prod UX
Two tests had been failing on -short for several phases; the
comfortable "pre-existing failures" framing was masking that both
were stale, not flaky — each test predated a deliberate UX rewire
that nobody updated the assertion against.
TestMageSpellbookLineInRender — commit 8bf7d35 (UX S7 jargon sweep)
reshaped the spellbook line to "**Spellbook:** N / M leveled spells
learned" and intentionally dropped the redundant "(can learn N more)"
trailer. Test was still asserting "2/10" (no spaces) and the dropped
hint. Updated to track the live "N / M leveled spells learned"
format; comment cites the sweep commit.
TestAdv2Scenario_ZoneRunGoblinWarrens — commit 886eb5a (turn-based
elite/boss combat) moved Elite/Boss rooms off the auto-resolve
SimulateCombat path onto the manual !fight + !attack engine; !zone
advance now stops at the doorway and only progresses past a won
CombatSession. The scenario test was only calling !advance, so it
spun in place at room 4 (the elite). Loop now detects Elite/Boss
prev-rooms, opens with !fight if the session doesn't exist, drains
!attack rounds until the session terminates, then falls through to
!advance to clear the room (won → walk graph; lost/fled → terminate
next pass). maxSteps doubled to absorb the fight-then-advance pairs;
inner !attack cap at 60 rounds covers RNG tail.
Both -short tests now pass; full -short suite green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -175,11 +175,14 @@ func TestMageSpellbookLineInRender(t *testing.T) {
|
||||
}
|
||||
|
||||
out := renderSpellsList(c)
|
||||
// L3 cap = 10, count = 2.
|
||||
if !strings.Contains(out, "Spellbook:") || !strings.Contains(out, "2/10") {
|
||||
// L3 cap = 10, count = 2. UX S7 jargon sweep (8bf7d35) reshaped
|
||||
// the line to "**Spellbook:** N / M leveled spells learned" and
|
||||
// dropped the redundant "(can learn N more)" trailer — the
|
||||
// "N / M" already conveys remaining capacity. Assertion tracks
|
||||
// the live format; if the line ever loses the count or the cap
|
||||
// the substrings still pin the regression.
|
||||
if !strings.Contains(out, "**Spellbook:**") ||
|
||||
!strings.Contains(out, "2 / 10 leveled spells learned") {
|
||||
t.Errorf("renderSpellsList missing/wrong Spellbook line; got\n%s", out)
|
||||
}
|
||||
if !strings.Contains(out, "can learn 8 more") {
|
||||
t.Errorf("renderSpellsList missing headroom hint; got\n%s", out)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user