Search in sources :

Example 6 with BaseGridCell

use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell in project kie-wb-common by kiegroup.

the class ExpressionEditorGridRowTest method testRowLowerThanDefault.

@Test
@SuppressWarnings("unchecked")
public void testRowLowerThanDefault() {
    when(view.getHeight()).thenReturn(DEFAULT_HEIGHT - 1);
    final GridRow row = spy(ExpressionEditorGridRow.class);
    final Map<Integer, GridCell<?>> cells = new Maps.Builder<Integer, GridCell<?>>().put(0, new BaseGridCell<>(new ExpressionCellValue(Optional.of(view)))).build();
    when(row.getCells()).thenReturn(cells);
    assertThat(row.getHeight()).isBetween(0D, DEFAULT_HEIGHT);
}
Also used : BaseGridCell(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell) ExpressionCellValue(org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionCellValue) GridRow(org.uberfire.ext.wires.core.grids.client.model.GridRow) GridCell(org.uberfire.ext.wires.core.grids.client.model.GridCell) BaseGridCell(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell) Test(org.junit.Test)

Example 7 with BaseGridCell

use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell in project kie-wb-common by kiegroup.

the class LiteralExpressionGridRowTest method testGetHeightWithHasDynamicHeightCell.

@Test
public void testGetHeightWithHasDynamicHeightCell() {
    final GridRow row = spy(new LiteralExpressionGridRow());
    final Map<Integer, GridCell> cells = new HashMap<Integer, GridCell>() {

        {
            put(0, new MockHasDynamicHeightCell<>(new BaseGridCellValue<>("cheese")));
            put(1, new BaseGridCell<>(new BaseGridCellValue<>("cheese")));
        }
    };
    doReturn(cells).when(row).getCells();
    assertThat(row.getHeight()).isEqualTo(CELL_HEIGHT);
}
Also used : HashMap(java.util.HashMap) GridRow(org.uberfire.ext.wires.core.grids.client.model.GridRow) GridCell(org.uberfire.ext.wires.core.grids.client.model.GridCell) BaseGridCell(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell) BaseGridCellValue(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue) Test(org.junit.Test)

Example 8 with BaseGridCell

use of org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell in project kie-wb-common by kiegroup.

the class LiteralExpressionGridRowTest method testGetHeightWithoutHasDynamicHeightCell.

@Test
public void testGetHeightWithoutHasDynamicHeightCell() {
    final GridRow row = spy(new LiteralExpressionGridRow());
    final Map<Integer, GridCell> cells = new HashMap<Integer, GridCell>() {

        {
            put(0, new BaseGridCell<>(new BaseGridCellValue<>("cheese")));
        }
    };
    doReturn(cells).when(row).getCells();
    assertThat(row.getHeight()).isEqualTo(DEFAULT_HEIGHT);
}
Also used : HashMap(java.util.HashMap) GridRow(org.uberfire.ext.wires.core.grids.client.model.GridRow) GridCell(org.uberfire.ext.wires.core.grids.client.model.GridCell) BaseGridCell(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell) BaseGridCellValue(org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)8 BaseGridCell (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCell)8 GridCell (org.uberfire.ext.wires.core.grids.client.model.GridCell)7 GridRow (org.uberfire.ext.wires.core.grids.client.model.GridRow)6 ExpressionCellValue (org.kie.workbench.common.dmn.client.editors.expressions.types.context.ExpressionCellValue)5 HashMap (java.util.HashMap)2 Maps (org.kie.soup.commons.util.Maps)2 BaseGridCellValue (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridCellValue)2 HasExpression (org.kie.workbench.common.dmn.api.definition.HasExpression)1 Expression (org.kie.workbench.common.dmn.api.definition.model.Expression)1 LiteralExpression (org.kie.workbench.common.dmn.api.definition.model.LiteralExpression)1 LiteralExpressionGrid (org.kie.workbench.common.dmn.client.editors.expressions.types.literal.LiteralExpressionGrid)1 BaseExpressionGrid (org.kie.workbench.common.dmn.client.widgets.grid.BaseExpressionGrid)1 BaseDOMElementSingletonColumnTest (org.kie.workbench.common.dmn.client.widgets.grid.columns.BaseDOMElementSingletonColumnTest)1 BaseUIModelMapper (org.kie.workbench.common.dmn.client.widgets.grid.model.BaseUIModelMapper)1 DMNGridData (org.kie.workbench.common.dmn.client.widgets.grid.model.DMNGridData)1 Callback (org.uberfire.client.callbacks.Callback)1 GridData (org.uberfire.ext.wires.core.grids.client.model.GridData)1 BaseGridData (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridData)1 BaseGridRow (org.uberfire.ext.wires.core.grids.client.model.impl.BaseGridRow)1