Search in sources :

Example 1 with ListSelectorItem

use of org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorItem in project kie-wb-common by kiegroup.

the class UndefinedExpressionColumnTest method testGetItems.

@Test
public void testGetItems() {
    final List<ListSelectorItem> items = column.getItems(0, 0);
    assertThat(items).isNotNull();
    assertThat(items.size()).isEqualTo(1);
    final ListSelectorItem item = items.get(0);
    assertThat(item).isInstanceOf(ListSelectorTextItem.class);
    final ListSelectorTextItem textItem = (ListSelectorTextItem) item;
    assertThat(textItem.getText()).isEqualTo(LiteralExpression.class.getSimpleName());
    textItem.getCommand().execute();
    verify(gridWidget).onExpressionTypeChanged(eq(ExpressionType.LITERAL_EXPRESSION));
}
Also used : ListSelectorItem(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorItem) LiteralExpression(org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression) ListSelectorTextItem(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorTextItem) Test(org.junit.Test)

Example 2 with ListSelectorItem

use of org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorItem in project kie-wb-common by kiegroup.

the class UndefinedExpressionColumnTest method testOnItemSelectedWithExpressionTypeSelected.

@Test
public void testOnItemSelectedWithExpressionTypeSelected() {
    final List<ListSelectorItem> items = column.getItems(0, 0);
    final ListSelectorTextItem ti = (ListSelectorTextItem) items.get(0);
    column.onItemSelected(ti);
    verify(gridWidget).onExpressionTypeChanged(eq(ExpressionType.LITERAL_EXPRESSION));
}
Also used : ListSelectorItem(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorItem) ListSelectorTextItem(org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorTextItem) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 ListSelectorItem (org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorItem)2 ListSelectorTextItem (org.kie.workbench.common.dmn.client.widgets.grid.controls.list.HasListSelectorControl.ListSelectorTextItem)2 LiteralExpression (org.kie.workbench.common.dmn.api.definition.v1_1.LiteralExpression)1