Closed klauss42 closed 2 years ago
Hi Klaus, yeah it could indeed be related to #99. Just thinking out loud: which DataProvider implementation are you using please? Perhaps there's a bug in the DataProvider implementation which returns more data than the Query asks for? Currently the Query will ask for 1 (one) item only (thanks to #99).
Hey Martin The dataProvider used in the test is a mocked variant of an AbstractBackendDataProvider which worked properly for quite some time already.
The problem is the current implementation of the _get(). If I use _fetch() instead of _get(), the test would suceed:
val grid = _get<Grid<EstimateViewModel>>(){ id = "estimates-grid" }
val size = grid.dataCommunicator.itemCount // size == 2
val list = grid._fetch(0, 10) // list of 2 elements
assertThat(list[0].estimateNumber).isEqualTo("estimateNumber") // succeeds
assertThat(grid._get(0).estimateNumber).isEqualTo("estimateNumber") // <= FAILS
I hope this helps
Greetz from Hamburg BTW: Your code from last summer is still working rock solid:-)
Klaus
Haha, love to hear that :-D Greetings to Hamburg from Finland :+1: :wave:
Could it be that your mocked DataProvider always returns 2 items? If yes, then I think that grid._fetch(0,1)
should fail as well. Could you briefly return just one item from your data provider, to see whether that would fix the exception?
Hey again. Yes, you're right. _fetch(0,1) also fails. I have to review our data provider mock mock
Confirmed. If the data provider mock just returns 1 item if, the exception in _get() is gone. I have to fix our mock, so that it handles the limit param properly
Since upgrading to Karibu testing 1.3.10 we get the following error for a simple grid test that worked fine so far:
Code snippet:
I think this has been introduced by changes for issue #99
I have no idea for a workaround so far