Module:GetShortDescription/testcases: Difference between revisions

Content deleted Content added
fix more tests
calming the error messages down a bit + test for nonexistent page
Line 7:
 
function p:test__no_name_param()
self:preprocess_equals('{{#invoke:GetShortDescription|main}}', '<strongspan classstyle="errorcolor:#d33">ERROR with invocation of [[Module:GetShortDescription]]: requires a page name (including namespace) MUST be provided.</strongspan>', {combined = 1})
end
 
function p:test__no_name_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=}}', '<strongspan classstyle="errorcolor:#d33">ERROR with invocation of [[Module:GetShortDescription]]: requires a page name (including namespace) MUST be provided.</strongspan>', {combined = 1})
end
 
Line 24:
function p:test__no_fallback_value()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/sandbox/no explicit short description|fallback=}}', "")
end
 
--[[ nonexistent page name ]]
 
function p:test__nonexistent_page_name()
self:preprocess_equals('{{#invoke:GetShortDescription|main|name=User:Fred Gandt/nonexistent page}}', '<span style="color:#d33">[[Module:GetShortDescription]] could not getContent of [[:User:Fred Gandt/nonexistent page|User:Fred Gandt/nonexistent page]]</span>', {combined = 1})
end