[create]
See Global Lua Modules/Editnotice load
- Subpages
-- Unit tests for [[Module:Editnotice load]]. Click talk page to run tests.
local p = require("Dev:Editnotice load")
local ScribuntoUnit = require('Dev:ScribuntoUnit')
local suite = ScribuntoUnit:new()
-- Check to see if conversion to and from editnotice works well
function suite:testGetTitleNotice()
local title = mw.title.new("Dev Wiki:Sandbox")
if title.id == 0 then return end
local editnoticeData = p.getEditnotice(self.frame, {}, title.prefixedText, p.cfg.editnotice_types.title)
self:assertEquals(editnoticeData.title, p.cfg.pseudo_ns_name .. "/" .. p.cfg.editnotice_types.title .. "/" .. title.prefixedText, "Different title for title notice!")
self:assertEquals(editnoticeData.content, self.frame:expandTemplate{ title = editnoticeData.title }, "Title notice contents do not match!")
end
return suite