FlowingCode / GridHelpers

Several grid recipes for Vaadin 23+ (and 22), ready to use. DOES NOT require extending Grid.
https://addonsv23.flowingcode.com/grid-helpers
Apache License 2.0
12 stars 1 forks source link

heightByRows integration test fails #80

Closed javier-godoy closed 1 year ago

javier-godoy commented 1 year ago

The following test fails (last visible row index is 9, the 10th column is only partially visible)

    $server.setHeightMode(HeightMode.ROW);
    $server.setHeightByRows(10);
    assertEquals(10, grid.getLastVisibleRowIndex());

image

However, a second call to setHeightByRows yields the expected result:

    $server.setHeightMode(HeightMode.ROW);
    $server.setHeightByRows(10);
    $server.setHeightByRows(10);
    assertEquals(10, grid.getLastVisibleRowIndex());

In the first test, when setHeightByRows(10) is called, it seems that the height calculation or rendering process may not have completed immediately, causing the last visible row index assertion to fail.

In the second test, when setHeightByRows(10) is called for the second time, it appears that the grid is already rendered or has completed the necessary height calculations. As a result, the last visible row index is correctly determined, and the assertion passes.