fix: harden quest poi filtering and objective refresh

This commit is contained in:
Xurkon
2026-06-13 08:30:41 -05:00
parent 12b30cd566
commit 8898dcf96a
5 changed files with 165 additions and 2 deletions
@@ -0,0 +1,28 @@
local function read(path)
local f = assert(io.open(path, "r"), "cannot open " .. path)
local content = f:read("*a")
f:close()
return content
end
local function has(content, needle)
return content:find(needle, 1, true) ~= nil
end
describe("Quest objective refresh events", function()
local handler = read("Modules/Quest/QuestEventHandler.lua")
it("does not depend on a later QUEST_LOG_UPDATE after QUEST_WATCH_UPDATE", function()
local start = assert(handler:find("function _QuestEventHandler:QuestWatchUpdate", 1, true))
local finish = assert(handler:find("local _UnitQuestLogChangedCallback", start, true))
local body = handler:sub(start, finish)
assert.is_true(has(handler, "_questWatchUpdateDebounceTimer"))
assert.is_true(has(handler, "_questWatchUpdateFollowUpTimer"))
assert.is_true(has(body, "QuestieQuest:SetObjectivesDirty(questId)"))
assert.is_true(has(body, "state = QUEST_LOG_STATES.QUEST_ACCEPTED"))
assert.is_true(has(body, "C_Timer.NewTimer(0.2"))
assert.is_true(has(body, "C_Timer.NewTimer(1.0"))
assert.is_true(has(body, "_QuestEventHandler:QuestLogUpdate()"))
end)
end)