blob: 41f572e63f02ca1edd13ef1ad83339062fcdb86d [file] [log] [blame]
package org.apache.myfaces.html5.renderkit.input;
import org.apache.myfaces.html5.component.HtmlInputEmail;
import org.apache.myfaces.html5.component.input.HtmlInputDateTime;
import org.apache.myfaces.html5.test.AbstractHtml5ViewControllerTestCase;
import org.apache.myfaces.html5.test.HtmlCheckAttributesUtil;
import org.apache.myfaces.html5.test.HtmlRenderedAttr;
/**
* @author Ali Ok (aliok@apache.org)
*/
public class HtmlInputEmailRendererTest extends AbstractHtml5ViewControllerTestCase {
private HtmlInputEmail htmlInputEmail;
public HtmlInputEmailRendererTest(String name) {
super(name);
}
@Override
public void setUp() throws Exception {
super.setUp();
htmlInputEmail = new HtmlInputEmail();
}
public void testPassThruHtmlProperties() throws Exception {
HtmlRenderedAttr[] attrs = {
//Html5 Global Props
new HtmlRenderedAttr("draggable", true, "draggable=\"true\""),
new HtmlRenderedAttr("hidden", true, "hidden=\"true\""),
//Common input props
new HtmlRenderedAttr("align"),
new HtmlRenderedAttr("alt"),
new HtmlRenderedAttr("maxlength", 3, "maxlength=\"3\""),
new HtmlRenderedAttr("readonly", true, "readonly=\"true\""),
new HtmlRenderedAttr("style"),
new HtmlRenderedAttr("styleClass", "styleClass", "class=\"styleClass\""),
new HtmlRenderedAttr("dir"),
new HtmlRenderedAttr("lang"),
new HtmlRenderedAttr("title"),
new HtmlRenderedAttr("accesskey"),
new HtmlRenderedAttr("tabindex"),
new HtmlRenderedAttr("disabled", true, "disabled=\"true\""),
//Input props
new HtmlRenderedAttr("autofocus", true, "autofocus=\"true\""),
new HtmlRenderedAttr("datalist", "datalist", "list=\"datalist\""),
//email input props
new HtmlRenderedAttr("required", true, "required=\"true\""),
new HtmlRenderedAttr("multiple", true, "multiple=\"true\""),
new HtmlRenderedAttr("placeholder"),
};
HtmlCheckAttributesUtil.checkRenderedAttributes(htmlInputEmail, facesContext, writer, attrs);
if(HtmlCheckAttributesUtil.hasFailedAttrRender(attrs))
{
fail(HtmlCheckAttributesUtil.constructErrorMessage(attrs, writer.getWriter().toString()));
}
}
}