use of com.vaadin.flow.component.Html in project flow by vaadin.
the class HTMLTest method brokenHtml.
@Test
public void brokenHtml() {
Html html = new Html("<b></div>");
Assert.assertEquals("b", html.getElement().getTag());
Assert.assertEquals("", html.getInnerHtml());
}
use of com.vaadin.flow.component.Html in project flow by vaadin.
the class HTMLTest method rootAttributes.
@Test
public void rootAttributes() {
Html html = new Html("<span foo='bar'>hello</span>");
Assert.assertEquals(Tag.SPAN, html.getElement().getTag());
Assert.assertEquals(1, html.getElement().getAttributeNames().count());
Assert.assertEquals("bar", html.getElement().getAttribute("foo"));
Assert.assertEquals("hello", html.getInnerHtml());
}
use of com.vaadin.flow.component.Html in project flow by vaadin.
the class PushConfigurator method construct.
private void construct() {
for (PushMode mode : PushMode.values()) {
pushMode.addOption(mode.name(), mode);
}
for (Transport transp : Transport.values()) {
transport.addOption(transp.name(), transp);
fallbackTransport.addOption(transp.name(), transp);
}
listeners();
paramValue.add(parameter, value, set);
status.setId("status");
vl.add(pushMode, transport, fallbackTransport, paramValue, new Html("<hr></hr>"), status);
add(vl);
}
use of com.vaadin.flow.component.Html in project flow by vaadin.
the class HTMLTest method extraWhitespace.
@Test
public void extraWhitespace() {
String input = //
" <span> " + //
" <div>" + //
" <b>Hello!</b>" + //
" </div>" + "</span>" + //
" " + //
"" + "";
Html html = new Html(input);
Assert.assertEquals(Tag.SPAN, html.getElement().getTag());
String expectedInnerHtml = input.replaceAll("^[ ]*<span>", "").replaceAll("</span>[ ]*$", "");
Assert.assertEquals(expectedInnerHtml, html.getInnerHtml());
}
use of com.vaadin.flow.component.Html in project flow by vaadin.
the class HTMLTest method simpleHtml.
@Test
public void simpleHtml() {
Html html = new Html("<span>hello</span>");
Assert.assertEquals(Tag.SPAN, html.getElement().getTag());
Assert.assertEquals("hello", html.getInnerHtml());
}
Aggregations