Files
amibis/Amibis/Tests/test_data.lua
T
dfj 48040c3ae1 Refresh T5 BiS lists from wowtbc.gg and normalize source formatting
All 20 T5 tables regenerated from the current wowtbc.gg page-data
JSON (same group/raid-variant extraction as T4/T6): fixes 9 stale items
(Quagmirran's Eye trinket, Corruptor set, Shapeshifter's Signet,
Ranger-General's Chestguard, Band of Eternity v2, etc.) and aligns
slot sets with the site's default view. Warlock T5 now splits:
Affliction gets WARLOCK_AFFLICTION_T5 (Corruptor), Demonology and
Destruction keep Voidheart. Source strings normalized: quest rewards
and dungeon bosses dash-joined, professions space-joined, site typos
folded (Mother Sharaz, Karanthress, Blood Furnace HC). 81 tests.
2026-10-11 16:41:29 +02:00

183 lines
6.9 KiB
Lua

-- Data integrity tests for BISLists.lua — run offline, no WoW client needed.
local _, ns = ...
local BIS = ns.Data.BISLists
local VALID_SLOTS = {
Head = true, Neck = true, Shoulder = true, Back = true, Chest = true,
Wrist = true, Hands = true, Waist = true, Legs = true, Feet = true,
Finger0 = true, Finger1 = true, Trinket0 = true, Trinket1 = true,
MainHand = true, SecondaryHand = true, Ranged = true,
}
local function validate_entry(slot, entry)
expect(VALID_SLOTS[slot]).toBeTruthy()
expect(type(entry.itemID)).toEqual("number")
expect(entry.itemID > 0).toBeTruthy()
expect(type(entry.name)).toEqual("string")
expect(#entry.name > 0).toBeTruthy()
expect(type(entry.source)).toEqual("string")
expect(#entry.source > 0).toBeTruthy()
if entry.enchant then
expect(type(entry.enchant.id)).toEqual("number")
expect(type(entry.enchant.name)).toEqual("string")
expect(#entry.enchant.name > 0).toBeTruthy()
end
end
describe("BIS data registry", function()
local classes = BIS:GetAvailableClasses()
it("covers all 9 classes", function()
expect(#classes).toEqual(9)
end)
for _, class in ipairs(classes) do
local specs = BIS:GetAvailableSpecs(class)
table.sort(specs)
it(class .. " has all 3 specs", function()
expect(#specs).toEqual(3)
end)
for _, spec in ipairs(specs) do
it(class .. "/" .. spec .. " lists are well-formed", function()
local phases = BIS:GetAvailablePhases(class, spec)
expect(#phases > 0).toBeTruthy()
for _, phase in ipairs(phases) do
local list = BIS:GetBISList(class, spec, phase)
expect(list).toBeTruthy()
local count = 0
for slot, entry in pairs(list) do
count = count + 1
validate_entry(slot, entry)
end
expect(count >= 8).toBeTruthy()
end
end)
end
end
end)
describe("phase ordering and resolution", function()
it("returns phases in canonical order", function()
local phases = BIS:GetAvailablePhases("PRIEST", "Shadow")
expect(phases[1]).toEqual("T4")
expect(phases[2]).toEqual("T5")
expect(phases[3]).toEqual("T6")
end)
it("reports the latest phase for every spec", function()
for _, class in ipairs(BIS:GetAvailableClasses()) do
for _, spec in ipairs(BIS:GetAvailableSpecs(class)) do
expect(BIS:GetLatestPhase(class, spec)).toEqual("T6")
end
end
end)
it("keeps the saved phase when it exists", function()
expect(BIS:ResolvePhase("PRIEST", "Shadow", "T6")).toEqual("T6")
expect(BIS:ResolvePhase("PRIEST", "Shadow", "T5")).toEqual("T5")
end)
it("falls back to the first available phase", function()
expect(BIS:ResolvePhase("PALADIN", "Protection", "T5")).toEqual("T4")
expect(BIS:ResolvePhase("DRUID", "Feral Combat", "T5")).toEqual("T4")
expect(BIS:ResolvePhase("DRUID", "Balance", "T6")).toEqual("T6")
end)
it("returns preferred phase for unknown class", function()
expect(BIS:ResolvePhase("DEATHKNIGHT", "Frost", "T5")).toEqual("T5")
end)
it("returns nil lookup for unknown spec", function()
expect(BIS:GetBISList("PRIEST", "Nonexistent", "T6")).toBeNil()
end)
end)
describe("known T6 spot checks", function()
it("shadow priest T6 head is the Hyjal token", function()
local list = BIS:GetBISList("PRIEST", "Shadow", "T6")
expect(list["Head"].itemID).toEqual(31064)
expect(list["Head"].name).toEqual("Hood of Absolution")
end)
it("discipline priest shares the holy T6 list", function()
expect(BIS:GetBISList("PRIEST", "Discipline", "T6"))
.toEqual(BIS:GetBISList("PRIEST", "Holy", "T6"))
end)
it("hunter BM and MM share the T6 list", function()
expect(BIS:GetBISList("HUNTER", "Beast Mastery", "T6"))
.toEqual(BIS:GetBISList("HUNTER", "Marksmanship", "T6"))
end)
it("all three warlock specs share the T6 list", function()
local affliction = BIS:GetBISList("WARLOCK", "Affliction", "T6")
expect(BIS:GetBISList("WARLOCK", "Demonology", "T6")).toEqual(affliction)
expect(BIS:GetBISList("WARLOCK", "Destruction", "T6")).toEqual(affliction)
end)
end)
describe("T4 (Phase 1) data", function()
it("covers every spec", function()
for _, class in ipairs(BIS:GetAvailableClasses()) do
for _, spec in ipairs(BIS:GetAvailableSpecs(class)) do
local list = BIS:GetBISList(class, spec, "T4")
expect(list).toBeTruthy()
end
end
end)
it("uses Karazhan/Gruul/Magtheridon gear", function()
local list = BIS:GetBISList("PRIEST", "Shadow", "T4")
expect(list["Head"].itemID).toEqual(24266)
expect(list["MainHand"].name).toEqual("Nathrezim Mindblade")
expect(list["MainHand"].source).toEqual("Karazhan - Prince Malchezaar")
end)
it("paladin protection prot has no T5 entry", function()
local phases = BIS:GetAvailablePhases("PALADIN", "Protection")
expect(phases[1]).toEqual("T4")
expect(phases[2]).toEqual("T6")
expect(BIS:GetBISList("PALADIN", "Protection", "T5")).toBeNil()
end)
end)
describe("T5 (Phase 2) data", function()
it("shadow priest T5 trinket is current site data", function()
local list = BIS:GetBISList("PRIEST", "Shadow", "T5")
expect(list["Trinket1"].itemID).toEqual(27683)
expect(list["Trinket1"].name).toEqual("Quagmirran's Eye")
end)
it("warlock T5 splits between affliction and demonology/destruction", function()
local affliction = BIS:GetBISList("WARLOCK", "Affliction", "T5")
local demonology = BIS:GetBISList("WARLOCK", "Demonology", "T5")
local destruction = BIS:GetBISList("WARLOCK", "Destruction", "T5")
expect(affliction["Shoulder"].name).toEqual("Mantle of the Corruptor")
expect(demonology["Shoulder"].name).toEqual("Voidheart Mantle")
expect(demonology).toEqual(destruction)
local count = 0
for _ in pairs(affliction) do count = count + 1 end
expect(count >= 15).toBeTruthy()
end)
end)
describe("source formatting", function()
it("dash-joins quest rewards", function()
local list = BIS:GetBISList("PRIEST", "Holy", "T5")
expect(list["Neck"].source).toEqual("Quest Reward - Kael'thas and the Verdant Sphere")
end)
it("dash-joins heroic dungeon bosses", function()
local list = BIS:GetBISList("DRUID", "Balance", "T5")
expect(list["Trinket1"].source).toEqual("Slave Pens (H) - Quagmirran")
end)
it("space-joins profession vendors", function()
local list = BIS:GetBISList("DRUID", "Balance", "T5")
expect(list["Legs"].source).toEqual("Tailoring BoP Pattern (375)")
end)
end)