Module:Annotated link/testcases: Difference between revisions

Content deleted Content added
+ a bunch of  s
add test for categorisation of short descriptions with no spaces being displayed
Line 260:
function p:test__desc_first_letter_case_upper()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|desc_first_letter_case=upper}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] – Explicit short description")
end
 
--[[ categorisation of short descriptions with no spaces being displayed ]]
 
function p:test__categorise_no_space_descriptions()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description with no spaces}}', "[[:User:Fred Gandt/sandbox/explicit short description with no spaces|User:Fred Gandt/sandbox/explicit short description with no spaces]] – Spacelessness[[Category:Pages displaying short descriptions with no spaces via Module:AnnotatedLink]]", {nowiki = 1})
end
 
Line 307 ⟶ 313:
 
function p:test__only_explicit__fallback__explicit_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/no explicit short description|only=explicit|fallback=this is a fallback}}', "[[:User:Fred Gandt/sandbox/no explicit short description|User:Fred Gandt/sandbox/no explicit short description]] – this is a fallback")
end
 
function p:test__only_wikidata__fallback__wikidata_does_not_exist()
self:preprocess_equals('{{#invoke:AnnotatedLink|main|name=User:Fred Gandt/sandbox/explicit short description|only=wikidata|fallback=this is a fallback}}', "[[:User:Fred Gandt/sandbox/explicit short description|User:Fred Gandt/sandbox/explicit short description]] – this is a fallback")
end