Module:InfoboxImage/testcases
Appearance
![]() | This is the test cases page for the module Module:InfoboxImage. Results of the test cases. |
-- Unit tests for [[Module:InfoboxImage]]. Click talk page to run tests.
local p = require('Module:UnitTests')
function p:test1_parameters_nowiki()
self:preprocess_equals_preprocess_many('{{#invoke:InfoboxImage|InfoboxImage|image=Small_Sailboat_Image.jpg', '}}', '{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=Small_Sailboat_Image.jpg', '}}', {
{''},
{'|size=75'},
{'|size=200'},
{'|upright=yes'},
{'|upright=1.35'},
{'|alt=Alt'},
{'|title=Title'},
{'|thumbtime=Thumbtime'},
{'|link=Link'},
{'|border=yes'},
{'|center=yes'},
},{nowiki=1})
end
function p:test2_parameters_output()
self:preprocess_equals_preprocess_many('{{#invoke:InfoboxImage|InfoboxImage|image=Small_Sailboat_Image.jpg', '}}', '{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=Small_Sailboat_Image.jpg', '}}', {
{''},
{'|size=75'},
{'|size=200'},
{'|upright=yes'},
{'|upright=1.35'},
{'|alt=Alt'},
{'|title=Title'},
{'|thumbtime=Thumbtime'},
{'|link=Link'},
{'|border=yes'},
{'|center=yes'},
})
end
function p:test_simple()
self:preprocess_equals('{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=File:Cwm (window manager).png|size=250px}}', '{{#invoke:InfoboxImage|InfoboxImage|image=File:Cwm (window manager).png|size=250px}}')
end
function p:test_maxsize_height()
self:preprocess_equals('{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=File:Cwm (window manager).png|size=500px|sizedefault=250px|maxsize=x250px}}', '{{#invoke:InfoboxImage|InfoboxImage|image=File:Cwm (window manager).png|size=500px|sizedefault=250px|maxsize=x250px}}')
end
function p:test_maxsize_width()
self:preprocess_equals('{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=File:Cwm (window manager).png|size=500px|sizedefault=250px|maxsize=250px}}', '{{#invoke:InfoboxImage|InfoboxImage|image=File:Cwm (window manager).png|size=500px|sizedefault=250px|maxsize=250px}}')
end
return p