fix: skip malformed item objectives in cache
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
describe("Questie item name safety", function()
|
||||
local function read(path)
|
||||
local f = assert(io.open(path, "r"), "cannot open " .. path)
|
||||
local c = f:read("*a")
|
||||
f:close()
|
||||
return c
|
||||
end
|
||||
|
||||
before_each(function()
|
||||
dofile("Tests/wow_api_mock.lua")
|
||||
GetItemInfo = function()
|
||||
@@ -16,4 +23,11 @@ describe("Questie item name safety", function()
|
||||
local item = Item:CreateFromItemID("bad-id")
|
||||
assert.equals("item:bad-id", item:GetItemName())
|
||||
end)
|
||||
|
||||
it("skips malformed item objectives without an item id", function()
|
||||
local lib = read("Modules/Libs/QuestieLib.lua")
|
||||
assert.is_true(string.find(lib, "local itemId = objectiveDB.Id", 1, true) ~= nil)
|
||||
assert.is_true(string.find(lib, "if not itemId then", 1, true) ~= nil)
|
||||
assert.is_true(string.find(lib, "QuestieDB.itemDataOverrides[itemId]", 1, true) ~= nil)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user