Module:Sandbox/Izno/testcases

local myModule = require('Module:Sandbox/Izno') -- the module to be tested local ScribuntoUnit = require('Module:ScribuntoUnit') local suite = ScribuntoUnit:new

function suite:test_empty_string_is_empty self:assertEquals(, myModule.remove_disallowed_css()) end function suite:test_background_is_empty self:assertEquals('', myModule.remove_disallowed_css('background: #000;')) end function suite:test_background_color_is_empty self:assertEquals('', myModule.remove_disallowed_css('background-color: #000;')) end function suite:test_color_with_space_is_color self:assertEquals('color: #000', myModule.remove_disallowed_css('color: #000')) end function suite:test_color_without_space_is_color self:assertEquals('color:#000', myModule.remove_disallowed_css('color:#000')) end function suite:test_background_and_color_is_color self:assertEquals('color: #000;', myModule.remove_disallowed_css('background-color: #000; color: #000;')) end function suite:test_color_and_border_is_color self:assertEquals('color: #000;', myModule.remove_disallowed_css('color: #000; border-color: #000;')) end function suite:test_color_and_border_and_color2_is_color_and_color2 self:assertEquals('color: #111;color: #000;', myModule.remove_disallowed_css('color: #111; border-color: #000; color: #000;')) end function suite:test_colors3_with_1_border self:assertEquals('color: #111;color: #000;color: #222;', myModule.remove_disallowed_css('color: #111; border-color: #000; color: #000; color: #222;')) end function suite:test_colors3_with_1_border_upper self:assertEquals('colOr: #111;color: #000;coloR: #222;', myModule.remove_disallowed_css('colOr: #111; Border-color: #000; color: #000; coloR: #222;')) end function suite:test_box_shadow self:assertEquals('', myModule.remove_disallowed_css('box-shadow: inset 1px 1px 0 #000, inset -1px -1px 0 #000; ')) end

return suite