use of com.google.gwt.user.client.ui.ComplexPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method visible.
@Test
public void visible() {
// Given
ComplexPanel panel = new FlowPanel();
// Preconditions
assertThat(panel.isVisible()).isEqualTo(true);
// When
panel.setVisible(false);
// Then
assertThat(panel.isVisible()).isEqualTo(false);
}
use of com.google.gwt.user.client.ui.ComplexPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method remove.
@Test
public void remove() {
// Given
ComplexPanel panel = new FlowPanel();
Button b = new Button();
panel.add(b);
// Preconditions
assertThat(panel.getWidgetCount()).isEqualTo(1);
assertThat(b.getParent()).isEqualTo(panel);
// When
panel.remove(b);
// Then
assertThat(panel.getWidgetCount()).isEqualTo(0);
assertThat(b.getParent()).isNull();
}
use of com.google.gwt.user.client.ui.ComplexPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method remove_ByIndex.
@Test
public void remove_ByIndex() {
// Given
ComplexPanel panel = new FlowPanel();
Button b0 = new Button();
panel.add(b0);
Button b1 = new Button();
panel.add(b1);
// When
panel.remove(1);
// Then
assertThat(panel.getWidgetCount()).isEqualTo(1);
assertThat(panel.getWidget(0)).isEqualTo(b0);
assertThat(b0.getParent()).isEqualTo(panel);
assertThat(b1.getParent()).isNull();
}
use of com.google.gwt.user.client.ui.ComplexPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method add.
@Test
public void add() {
// Given
ComplexPanel panel = new FlowPanel();
RootPanel.get().add(panel);
assertThat(panel.isAttached()).isTrue();
assertThat(panel.getWidgetCount()).isEqualTo(0);
Button b1 = new Button();
assertThat(b1.isAttached()).isFalse();
assertThat(b1.getParent()).isNull();
// When
panel.add(b1);
// Then
assertThat(b1.isAttached()).isTrue();
assertThat(b1.getParent()).isEqualTo(panel);
assertThat(panel.getWidgetCount()).isEqualTo(1);
assertThat(panel.getWidget(0)).isEqualTo(b1);
assertThat(panel.getWidgetIndex(b1)).isEqualTo(0);
}
use of com.google.gwt.user.client.ui.ComplexPanel in project gwt-test-utils by gwt-test-utils.
the class ComplexPanelTest method title.
@Test
public void title() {
// Given
ComplexPanel panel = new FlowPanel();
// When
panel.setTitle("title");
// Then
assertThat(panel.getTitle()).isEqualTo("title");
}
Aggregations