use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method removeItem.
@Test
public void removeItem() {
// Given
MenuBar bar = new MenuBar();
MenuItem item0 = bar.addItem("test0", cmd);
MenuItem item1 = bar.addItem("test1", cmd);
// When
bar.removeItem(item0);
// Then
assertThat(bar.getItemIndex(item1)).isEqualTo(0);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method addSeparator.
@Test
public void addSeparator() {
// Given
MenuBar bar = new MenuBar();
bar.addItem("test0", cmd);
// When
MenuItemSeparator separator = bar.addSeparator();
bar.addItem("test1", cmd);
// Then
assertThat(bar.getSeparatorIndex(separator)).isEqualTo(1);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method constructor_Complex.
@Test
public void constructor_Complex() {
// Given
MenuBar bar = new MenuBar();
MenuBar subMenuBar = new MenuBar();
MenuItem item = new MenuItem("item", false, subMenuBar);
bar.addItem(item);
item.setCommand(cmd);
// Preconditions
assertThat(called).isEqualTo(false);
// When
Browser.click(bar, item);
// Then
assertThat(called).isEqualTo(true);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method addItem.
@Test
public void addItem() {
// Given
MenuBar bar = new MenuBar();
// When
MenuItem item0 = bar.addItem("test0", cmd);
MenuItem item1 = bar.addItem("test1", cmd);
// Then
assertThat(bar.getItemIndex(item0)).isEqualTo(0);
assertThat(bar.getItemIndex(item1)).isEqualTo(1);
assertThat(item0.getParentMenu()).isEqualTo(bar);
assertThat(item1.getParentMenu()).isEqualTo(bar);
}
use of com.google.gwt.user.client.ui.MenuBar in project gwt-test-utils by gwt-test-utils.
the class MenuBarTest method title.
@Test
public void title() {
// Given
MenuBar bar = new MenuBar();
// Preconditions
assertThat(bar.getTitle()).isEqualTo("");
// When
bar.setTitle("title");
// Then
assertThat(bar.getTitle()).isEqualTo("title");
}
Aggregations