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);
}
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);
}
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);
}
Aggregations