Add .gitea/workflows/tests.yaml per the Gitea Actions quick start:
check out the repo, install Lua 5.4, then run the offline suite
(lua5.4 Amibis/Tests/run.lua). A failed test fails the job.
Document the workflow in README, AGENTS.md, and the tests README.
Register the main frame ("AmibisMainFrame") in UISpecialFrames so Escape
hides it and suppresses the game menu while it is open, matching the
default UI panels.
Move the stats-retry timer cleanup into the frame's OnHide script so the
close button, Escape, and /amibis all stop the timer.
Tests: the mock now registers named frames in _G and runs OnHide scripts.
The UI suite simulates FrameXML's CloseSpecialWindows() and asserts the
frame hides and the retry timer is cleared. 108 passing.
RebuildStatRows hid the previous rows through vals.label, but StatValues
never stored the label font string. The first spec change that altered
the stat keys raised "attempt to index a nil value (field 'label')",
aborting RefreshUI before the new rows were created. The previous spec's
panel stayed on screen, so a Holy priest kept seeing Shadow's
"+Spell Damage" row instead of "+Healing".
Store the label in StatValues so old rows hide correctly and the panel
rebuilds with the new spec's profile.
Add a UI smoke test using mocked frames (font strings now record
text/shown; frames track Show/Hide/IsShown). It switches Shadow -> Holy
and asserts the visible rows change; with the bug reverted it fails with
the same nil-label error.
Also print usage for a bare "/amibis spec" instead of toggling the
window, which was a surprising side effect and made tests order-dependent.
107 passing.
The bar could change when switching phases: latestCompletionRatio was nil
until the selected phase's stats were complete AND the latest list was
cached, and the UI then fell back to the selected phase's own completion
ratio. Right after login the latest list's items are often not cached
yet, so switching phases visibly moved the bar.
Always compute a latest-phase ratio inside CompareGear: stats-based when
both the latest list and the equipped items are cached, otherwise slot
completion against the latest list. Return latestStatsComplete so the UI
can mark the estimate with "~" and keep retrying until stats load
(capped at 20 attempts). The UI now uses latestCompletionRatio directly
instead of falling back to the selected phase.
Also refresh on PLAYER_EQUIPMENT_CHANGED so gear swaps update the bar.
Tests: phase-independent ratio, slot-based fallback while the latest
list is uncached, and equal ratios across selected phases once cached.
106 passing.
Replace the flat per-spec key list with SPEC_STAT_PROFILES: an ordered
{ stat, weight } table for every class/spec. The panel now shows what
matters to the selected spec instead of falling back to spell stats for
physical specs: casters get spell damage/hit/crit/haste, melee get
strength/AP/hit/expertise/armor pen, tanks get stamina/armor/defense/
dodge/parry/block, healers get healing/spirit/MP5.
The same weights drive upgrade ranking, the completion ratio, and which
two gains are shown in the top-upgrades line, so e.g. spell damage
outweighs spirit for Shadow while stamina outweighs expertise for a
Protection tank.
Add GetItemStats mappings for physical stats (attack power, ranged/feral
AP, strength, agility, hit, expertise, armor pen, defense, dodge, parry,
block, block value, armor). TBC per-school hit/crit/haste keys fold into
one stat. Drop the unused spellPower row from TBC profiles.
Tests: weighted scoring expectations, physical/tank mappings, profile
coverage and 8-row panel limit, weighted ratios. 104 passing.
TBC items report per-school ratings with a different key shape than the
WotLK-era names the addon mapped: "spell haste" is
ITEM_MOD_HASTE_SPELL_RATING(_SHORT), not ITEM_MOD_SPELL_HASTE_RATING,
and crit is ITEM_MOD_CRIT_SPELL_RATING/MELEE/RANGED rather than
ITEM_MOD_SPELL_CRIT_RATING. As a result spell haste (and spell/melee
crit) on TBC gear scanned as zero, so the stats panel showed no haste
and upgrade scoring ignored it.
Map the TBC haste/crit keys alongside the existing generic ones, plus
non-_SHORT variants for safety. The alias logic still takes MAX per
stat, so an item that reports both forms is not double counted.
Tests cover TBC spell haste + crit, melee/ranged haste keys, and
generic+school-specific de-duplication. 96 passing.
The generic "spec <name>" branch matched before the "spec clear" check,
so clearing an override set overrideSpec to "Clear" and the UI then
looked for a spec called Clear instead of falling back to auto-detection.
Check the clear command first, collapse whitespace so "spec clear"
parses, and refresh the frame immediately when the override changes.
Spec names are also title-cased per word now, so "/amibis spec beast
mastery" resolves to "Beast Mastery".
Add test_slash.lua covering set/clear, case/whitespace normalization,
and the clear-as-spec-name regression. 93 tests passing.
Populate Zul'Aman gear for all 9 classes x 3 specs from the wowtbc.gg
page-data JSON, using the same per-phase `bis` extraction (group/raid
variant preferred) as the earlier tiers. ZA becomes the fourth phase in
PHASE_ORDER and the new default, so the progress bar now measures
completion against ZA.
Shared lists mirror the existing phase conventions: Discipline = Holy,
BM = MM, Combat = Subtlety, and all three warlock specs share one ZA
list. Relic entries (idols/librams/totems) stay omitted like T4-T6.
Two source corrections are folded in: one site data bug where Holy
Paladin's ZA main hand pointed at Hammer of Sanctification (Sunwell
only) is replaced with the T6 pick, Crystal Spire of Karabor, and
canonical item names replace the site's case/typo variants.
Tests: 88 passing, including ZA coverage, shared-list invariants, and
latest-phase progress against ZA.
76 tests covering BIS data integrity (all classes/specs/phases, slot
shape, spot checks), ScanItemStats alias aggregation (Frozen
Shadoweave double-count regression), CompareGear upgrade ranking with
spec-specific stat keys, phase resolution, and latest-phase completion.
Runs with any Lua 5.3+ interpreter via mocked WoW API; no client
required. Not referenced in the .toc.