Jump to content

Module:Wikidata link/testcases

From Wikisource
local p = require('Module:UnitTests')

function p:test_basics()
	local out

	out = '<span class="module-wikidata-link">[[wikipedia:Douglas Adams|Douglas Adams]]</span>'
    self:preprocess_equals('{{#invoke:wikidata link|link|wikidata=Q42}}', out, {nowiki=1})

	out = '<span class="module-wikidata-link">[[wikipedia:Douglas Adams|Mr. Adams]]</span>'
    self:preprocess_equals('{{#invoke:wikidata link|link|wikidata=Q42|label=Mr. Adams}}', out, {nowiki=1})

end

return p