Search in sources :

Example 1 with TextAreaSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class RelationGridTest method testBodyFactoryWhenNotNested.

@Test
public void testBodyFactoryWhenNotNested() {
    setupGrid(0);
    final TextAreaSingletonDOMElementFactory factory = grid.getBodyTextAreaFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) Test(org.junit.Test)

Example 2 with TextAreaSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class RelationGridTest method testBodyFactoryWhenNested.

@Test
public void testBodyFactoryWhenNested() {
    setupGrid(1);
    final TextAreaSingletonDOMElementFactory factory = grid.getBodyTextAreaFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) Test(org.junit.Test)

Example 3 with TextAreaSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class LiteralExpressionGridTest method testBodyFactoryWhenNested.

@Test
public void testBodyFactoryWhenNested() {
    setupGrid(1);
    final TextAreaSingletonDOMElementFactory factory = grid.getBodyTextAreaFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) Test(org.junit.Test)

Example 4 with TextAreaSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testBodyTextAreaFactoryWhenNested.

@Test
public void testBodyTextAreaFactoryWhenNested() {
    setupGrid(makeHasNameForDecision(), 1);
    final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 1, gridWidget);
    final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 1, gridWidget, new BaseGridCellValue<>("value"));
    final TextAreaSingletonDOMElementFactory factory = grid.getBodyTextAreaFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Test(org.junit.Test)

Example 5 with TextAreaSingletonDOMElementFactory

use of org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory in project kie-wb-common by kiegroup.

the class DecisionTableGridTest method testBodyTextAreaFactoryWhenNotNested.

@Test
public void testBodyTextAreaFactoryWhenNotNested() {
    setupGrid(makeHasNameForDecision(), 0);
    final GridCellTuple tupleWithoutValue = new GridCellTuple(0, 1, gridWidget);
    final GridCellValueTuple tupleWithValue = new GridCellValueTuple<>(0, 1, gridWidget, new BaseGridCellValue<>("value"));
    final TextAreaSingletonDOMElementFactory factory = grid.getBodyTextAreaFactory();
    assertThat(factory.getHasNoValueCommand().apply(tupleWithoutValue)).isInstanceOf(DeleteCellValueCommand.class);
    assertThat(factory.getHasValueCommand().apply(tupleWithValue)).isInstanceOf(SetCellValueCommand.class);
}
Also used : GridCellTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple) TextAreaSingletonDOMElementFactory(org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory) GridCellValueTuple(org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)6 TextAreaSingletonDOMElementFactory (org.kie.workbench.common.dmn.client.widgets.grid.columns.factory.TextAreaSingletonDOMElementFactory)6 GridCellTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellTuple)2 GridCellValueTuple (org.kie.workbench.common.dmn.client.widgets.grid.model.GridCellValueTuple)2