use of com.google.gwt.dom.client.HeadingElement in project gwt-test-utils by gwt-test-utils.
the class AnchorTest method html.
@Test
public void html() {
// Given
Anchor a = new Anchor("<h1>foo</h1>", true);
assertThat(a.getHTML()).isEqualTo("<h1>foo</h1>");
// When
a.setHTML("<h1>test</h1>");
// Then
assertThat(a.getHTML()).isEqualTo("<h1>test</h1>");
assertThat(a.getElement().getChildCount()).isEqualTo(1);
HeadingElement h1 = a.getElement().getChild(0).cast();
assertThat(h1.getTagName()).isEqualTo("H1");
assertThat(h1.getInnerText()).isEqualTo("test");
}
use of com.google.gwt.dom.client.HeadingElement in project gwt-test-utils by gwt-test-utils.
the class HyperlinkTest method html.
@Test
public void html() {
// Given
Hyperlink link = new Hyperlink();
// When
link.setHTML("<h1>test</h1>");
// Then
assertThat(link.getHTML()).isEqualTo("<h1>test</h1>");
assertThat(link.getElement().getChild(0).getChildCount()).isEqualTo(1);
HeadingElement h1 = link.getElement().getChild(0).getChild(0).cast();
assertThat(h1.getTagName()).isEqualTo("H1");
assertThat(h1.getInnerText()).isEqualTo("test");
}
Aggregations