local myModule = require('Module:Sandbox/Izno') -- the module to be testedlocal ScribuntoUnit = require('Module:ScribuntoUnit')local suite = ScribuntoUnit:new
function suite:test_empty_string_is_empty self:assertEquals(, myModule.remove_disallowed_css())endfunction suite:test_background_is_empty self:assertEquals(, myModule.remove_disallowed_css('background: #000;'))endfunction suite:test_background_color_is_empty self:assertEquals(, myModule.remove_disallowed_css('background-color: #000;'))endfunction suite:test_color_with_space_is_color self:assertEquals('color: #000', myModule.remove_disallowed_css('color: #000'))endfunction suite:test_color_without_space_is_color self:assertEquals('color:#000', myModule.remove_disallowed_css('color:#000'))endfunction suite:test_background_and_color_is_color self:assertEquals('color: #000;', myModule.remove_disallowed_css('background-color: #000; color: #000;'))endfunction suite:test_color_and_border_is_color self:assertEquals('color: #000;', myModule.remove_disallowed_css('color: #000; border-color: #000;'))endfunction 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;'))endfunction 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;'))endfunction 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;'))endfunction 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