UI Unit Testing / test(c).setValue(v) / isFromClient=false

Hi,
I am new to UI Unit Testing and encountered an unexpected behavior when using:

test(component).setValue(value);

In the corresponding ComponentValueChangeEvent the value of isFromClient is set to false.

However, since I’m trying to simulate the client, I excpected isFromClient it to be true.

  1. Technical rationale: Are there underlying reasons why isFromClient must remain false in this testing context?
  2. Future support: If not, could this be adjusted in a future Vaadin release?
  3. Workarounds: Is there a recommended way to simulate a client-originated change so that isFromClient == true?

In my application I only fire certain actions when the client actually changes the value, so this distinction is crucial for my tests.

If this behavior has already been addressed in a newer Vaadin version, please let me know—otherwise any guidance or workaround would be greatly appreciated!

Thanks in advance,
Florian

Hi Florian,

this is a known issue: ComponentEvent.isFromClient() is false despite using TestWrappers.test() in a SpringUIUnitTest · Issue #1814 · vaadin/testbench · GitHub

Please give the issue an upvote :)

1 Like