Open main menu

Module:Plain sister/sandbox testcases

Documentation icon Module documentation[create]
-- Unit tests for [[Module:Edition]]. Go to the talk page to view test results.
local testSuit = require('Module:UnitTests')

function testSuit:test_inline()
	local prefix = '<li class="sisitem"><span class="sisicon" style="padding-right:1ex;">[[Image:Wikimedia-logo.svg|frameless|18px|link=Special:sitematrix|alt=Sister Projects.]]</span>[[Special:sitematrix|sister projects]]:&#32;'

	-- Not a Wikisource item.
	self:preprocess_equals(
		'{{#invoke:Plain sister/sandbox|interprojetPart|wikidata=Q1}}',
		prefix .. '[[w:Universe|Wikipedia article]],&#32;[[c:Category:Universe|Commons category]],&#32;[[q:Universe|quotes]],&#32;[[v:Universe|course]],&#32;[[d:Q1|Wikidata item]].</li>',
		{nowiki=1}
	)
	
	-- Wikisource author.
	self:preprocess_equals(
		'{{#invoke:Plain sister/sandbox|interprojetPart|wikidata=Q369790}}',
		prefix .. '[[w:George Gissing|Wikipedia article]],&#32;[[c:George Gissing|Commons gallery]],&#32;[[c:Category:George Gissing|Commons category]],&#32;[[q:George Gissing|quotes]],&#32;[[d:Q369790|Wikidata item]].</li>',
		{nowiki=1}
	)

	-- Wikisource edition.
	self:preprocess_equals(
		'{{#invoke:Plain sister/sandbox|interprojetPart|wikidata=Q23308118}}',
		prefix .. '[[w:The Nether World|Wikipedia article]],&#32;[[c:Category:The Nether World (novel)|Commons category]],&#32;[[d:Q23308118|Wikidata item]].</li>',
		{nowiki=1}
	)

	-- Wikisource edition, via template.
	self:preprocess_equals(
		'{{Plain sister/sandbox|wikidata=Q23308118}}',
		'<ul id="plainSister" style="display:inline-block; font-size:93%; line-height:normal; list-style-type:none; list-style-image:none; list-style-position:outside;'
		.. ' border:1px solid #AAA; float:right; clear:right; margin:0.5ex 0.5ex 0.5ex 0.5ex; padding:0.0ex 0.0ex 0.0ex 0.0ex; background:#FFFFFF; background-color:#FFFFFF;">'
		.. prefix .. '[[w:The Nether World|Wikipedia article]],&#32;[[c:Category:The Nether World (novel)|Commons category]],&#32;[[d:Q23308118|Wikidata item]].</li></ul>',
		{nowiki=1}
	)

	-- An author.
	self:preprocess_equals(
		'{{#invoke:Plain sister/sandbox|interprojetPart|wikidata=Q15712330}}',
		prefix .. '[[w:Alice Hay Wadsworth|Wikipedia article]],&#32;[[d:Q15712330|Wikidata item]].</li>',
		{nowiki=1}
	)

end

return testSuit