Jump to content

Module:Mainspace editnotice/testcases

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by SD0001 (talk | contribs) at 17:08, 29 January 2024 (switch to ScribuntoUnit). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
-- Unit tests for [[Module:Mainspace editnotice]]. Click talk page to run tests.

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()
	self:assertNoticeEquals('Barack Obama', '{{BLP editintro}}')
end

return suite