use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method isAttachedWithAsAssertionErrorMessage.
@Test
public void isAttachedWithAsAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
// When
try {
GwtAssertions.assertThat(a).as("my anchor").isAttached();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
// Then
assertThat(e.getMessage()).isEqualTo("[my anchor] should be attached");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method isNotVisibleWithAsAndCustomAssertionErrorMessage.
@Test
public void isNotVisibleWithAsAndCustomAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
// When
try {
GwtAssertions.assertThat(a).as("my anchor").overridingErrorMessage("custom failure").isNotVisible();
fail("AssertionError should be thrown");
} catch (AssertionError e) {
// Then
assertThat(e.getMessage()).isEqualTo("[my anchor] custom failure");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class WidgetAssertTest method htmlIgnoreCaseWithAsAssertionErrorMessage.
@Test
public void htmlIgnoreCaseWithAsAssertionErrorMessage() {
// Given
Anchor a = new Anchor();
a.setHTML("<h3>Ada Byron</h3>");
// When
try {
GwtAssertions.assertThat(a).as("my anchor").htmlEqualsIgnoreCase("<h3>Ada Lovelace</h3>");
fail("AssertionError should be thrown");
} catch (AssertionError e) {
// Then
assertThat(e.getMessage()).isEqualTo("[(ignore case mode) my anchor HTML] expected:<\"<h3>Ada [Lovelace]</h3>\"> but was:<\"<h3>Ada [Byron]</h3>\">");
}
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class AnchorTest method visible.
@Test
public void visible() {
// Given
Anchor a = new Anchor();
assertThat(a.isVisible()).isEqualTo(true);
// When
a.setVisible(false);
// Then
assertThat(a.isVisible()).isEqualTo(false);
}
use of com.google.gwt.user.client.ui.Anchor in project gwt-test-utils by gwt-test-utils.
the class AnchorTest method tagName.
@Test
public void tagName() {
// Given
Anchor a = new Anchor();
// Then
assertThat(a.getElement().getTagName()).isEqualTo("a");
}
Aggregations