mvysny / karibu-testing

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

Adding _getRowComponents function #81

Closed hfazai closed 2 years ago

hfazai commented 2 years ago

Adding a function that retrieves the list of components produced by ComponentRenderer in given Grid row.

It's based on _getCellComponent but it retrives all cell components in a specific row.

mvysny commented 2 years ago

Could you please provide an use-case for this functionality? I'm not convinced of its usability and I have the following counter-reasons:

hfazai commented 2 years ago

Hi @mvysny ,

I wasn't aware of the usage of the usage of expectRow() on ComponentRenderer columns.

In my grid, I used ComponentRenderer because I wanted to access the rendered component so that I can apply style on it using element.style API. I didn't use ClassNameGenerator because style values are dynamic (for example the background color is calculated in my kotlin code depending on several conditions).

But indeed this made the grid very slow with big amount of data. so I'm tninking to use ClassNameGenerator and try to enumerate almost all possible styling values.

I thought to provide this method in case it's usefull for someone but I think your reasons are valid so I'm gonna close this PR.