mvysny / karibu-testing

Vaadin Server-Side Browserless Containerless Unit Testing
Apache License 2.0
113 stars 14 forks source link

TreeGrid expand problem #68

Closed vlipovetskii closed 2 years ago

vlipovetskii commented 3 years ago

Neither expand nor expandRecursively don't invoke lambda passed to addComponentColumn.

mvysny commented 3 years ago

Hmm, that is true, the expand() nor expandRecursively() doesn't actually render the data being fetched, therefore the ComponentRenderer lambda is not invoked.

However, once you start asserting on the items displayed in the TreeGrid using Karibu-Testing (using expectRow(), _dump(), _getFormatted() or any of the grid-formatting test functions), the ComponentRenderer must definitely be invoked at that point. Therefore, the correct way to test the ComponentRenderer/addComponentColumn() is to assert on the displayed contents, using the functions above.

Please let me know whether this works for your use-case.

mvysny commented 2 years ago

Closing as won't fix, please reopen if the issue is not fixed to your liking :+1: