From Wikipedia, the free encyclopedia
This is the current revision of this page, as edited by imported>SD0001 at 03:55, 3 February 2024 . The present address (URL) is a permanent link to this version.Revision as of 03:55, 3 February 2024 by imported>SD0001 (diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation
Jump to search
-- Unit tests for [[Module:Mainspace editnotice]]. Click talk page to run tests.
local TfaTitle = require('Module:TFA title')
local ScribuntoUnit = require('Module:ScribuntoUnit')
local suite = ScribuntoUnit:new()
function suite:assertNoticeEquals(page, notice)
self:assertEquals(
mw.text.killMarkers(suite.frame:preprocess(notice)),
mw.text.killMarkers(suite.frame:preprocess(
'{{#invoke:Mainspace editnotice|main|page='..page..'}}'))
)
end
function suite:testBlp()
-- In [[Category:Living people]]
self:assertNoticeEquals('Barack Obama', '{{BLP editintro}}')
-- In [[Category:Possibly living people]]
self:assertNoticeEquals('Earl Ashby', '{{BLP editintro}}')
end
function suite:testDisambig()
self:assertNoticeEquals('1998 hurricane season', '{{Disambig editintro}}')
self:assertNoticeEquals('M31', '{{Disambig editintro}}')
end
function suite:testRefideas()
self:assertNoticeEquals('Mobile Suit Victory Gundam', '{{Refideas editnotice}}')
end
function suite:testTfa()
self:assertNoticeEquals(TfaTitle.today_title(), '{{TFA editnotice}}')
end
function suite:testDraft()
-- Disambig page having a draft page
self:assertNoticeEquals('Example', '{{Disambig editintro}}{{Draft at}}')
end
return suite