use of com.google.gwt.dom.client.AnchorElement in project gwt-test-utils by gwt-test-utils.
the class JsArrayMixedTest method unshiftElement.
@Test
public void unshiftElement() {
// Given
AnchorElement anchor = Document.get().createAnchorElement();
anchor.setHref("http://lost.com");
// When
jsArrayMixed.unshift(anchor);
// Then
assertThat(jsArrayMixed.length()).isEqualTo(6);
assertThat(jsArrayMixed.join()).isEqualTo("<a href=\"http://lost.com\"></a>,,,,,true");
}
use of com.google.gwt.dom.client.AnchorElement in project gwt-test-utils by gwt-test-utils.
the class HTMLTest method html_withAnchor.
@Test
public void html_withAnchor() {
// Given
HTML widget = new HTML("<a href=\"foo\" target=\"bar\">baz</a>");
// When
NodeList<Element> nodeList = widget.getElement().getElementsByTagName("a");
// Then
assertThat(nodeList.getLength()).isEqualTo(1);
AnchorElement anchor = nodeList.getItem(0).cast();
assertThat(anchor.getHref()).isEqualTo("foo");
assertThat(anchor.getTarget()).isEqualTo("bar");
}
use of com.google.gwt.dom.client.AnchorElement in project gwt-test-utils by gwt-test-utils.
the class MainGwtTest method create.
@Test
public void create() {
// When
AnchorElement e = GWT.create(AnchorElement.class);
// Then
assertThat(e).isNotNull();
}
use of com.google.gwt.dom.client.AnchorElement in project gwt-test-utils by gwt-test-utils.
the class AnchorElementTest method as.
@Test
public void as() {
// When
AnchorElement asElement = AnchorElement.as(a);
// Then
assertThat(asElement).isEqualTo(a);
}
use of com.google.gwt.dom.client.AnchorElement in project gwt-test-utils by gwt-test-utils.
the class JsArrayMixedTest method getStringElement.
@Test
public void getStringElement() {
// Given
AnchorElement anchor = Document.get().createAnchorElement();
anchor.setHref("http://lost.com");
jsArrayMixed.set(2, anchor);
// When
String elementToString = jsArrayMixed.getString(2);
// Then
assertThat(elementToString).isEqualTo("<a href=\"http://lost.com\"></a>");
}
Aggregations