Closed satorstefan closed 2 years ago
At the moment there's no special support for Grid selection from Karibu-Testing, which means that you can use the standard Grid API grid.select()
(which unfortunately does nothing if Grid has no selection). What would be an ideal API? Probably the best would be to have grid._select(item: T)
which would deselect all items, then select given item, failing if the grid doesn't support selection. That way, you could rely on what is selected (since grid.select()
is ambiguous whether it deselects other items or not).
Also could be interesting to have support for grid._selectAll()
which would only work for multi-select and would call AbstractGridMultiSelectionModel.clientSelectAll()
.
grid._select(item: T) sounds good to me.
I am wondering how this would work with a grid that uses lazy loading and were the item to be selected is not visible from the start.
Any idea Martin?
Depends on how exactly the lazy loading works: whether it works in a bg thread or not. Please find some ideas at https://github.com/mvysny/karibu-testing/tree/master/karibu-testing-v10#testing-asynchronous-application
Hello Martin,
Is there a easy to to just test a component without having to add it to the the mainlayout?
Basically I want to test one of my custom component in isolation.
Everything that has a Route should be accessible, correct?
Would it be possible to have a meeting in 2-3 weeks so I could show you once how/and what I do with Karibu?
Best regards Stefan
Message ID: @.***>
Please open a new ticket for questions unrelated to this ticket.
This
code in the karibu based test is not the same that the client is calling.
The client is using selectFromClient(T item) in the end, which would throw an execption if trying to select items in a grid that does not support selection.
public class GridNoneSelectionModel implements GridSelectionModel {
public GridNoneSelectionModel() {
}
selection even though selection mode is currently set to NONE."); }
It seems to me that the client side is calling: @ClientCallable private void select(String key) { Optional var10000 = this.findByKey(String.valueOf(key)); GridSelectionModel var10001 = this.getSelectionModel(); var10000.ifPresent(var10001::selectFromClient); }
Why is there no way in karibu to select the items as the user would do it through the browser? / What is the way to select items in a grid?