Skip to content

test: detect client function calls on Vaadin 25.4 - #50

Open
paodb wants to merge 1 commit into
masterfrom
fix/client-calls-test-vaadin-25.4
Open

paodb wants to merge 1 commit into
masterfrom
fix/client-calls-test-vaadin-25.4

Conversation

@paodb

@paodb paodb commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Since vaadin/flow#25852, Element.callJsFunction sends one shared
expression and passes the function name as the first parameter, so
SimpleTimerClientCallsTest no longer finds _sync in the expression.
The test now also checks the first parameter. Tested against Vaadin 14,
23, 24, 25.1 and 25.4.0-alpha6.

Thanks @mstahv for the patch.

Close #48

Summary by CodeRabbit

  • Tests
    • Improved test call detection for function names supplied either directly in the JavaScript expression or as the first parameter.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test helper now recognizes queued JavaScript calls when the function name appears in the invocation expression or in the first parameter. The count helper uses this matching logic.

Changes

Client call test matching

Layer / File(s) Summary
Match queued JavaScript calls
src/test/java/com/flowingcode/vaadin/addons/simpletimer/SimpleTimerClientCallsTest.java
The count helper delegates to calls, which matches the requested function name against the invocation expression or the first parameter.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Suggested reviewers: scardanzan

Merge Risk: Minimal · up to 139d9

This change only updates a test so it recognizes client function calls on newer Vaadin versions. It does not alter add-on runtime behavior, and the merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the change: the test now detects client function calls on Vaadin 25.4. The raw summary confirms the test helper now also checks the first parameter of a queued JavaScript call, which m…
Linked Issues check Passed Issue #48 requires that SimpleTimerClientCallsTest.resumingOnAttachSyncsOnce pass on every supported Vaadin version. It suggests also checking getInvocation().getParameters(). At the reviewed head, Si…
Out of Scope Changes check Passed The whole-PR change set (merge base 2995747 to head 139d9cc) touches only SimpleTimerClientCallsTest.java, per the supplied summary (+12/-3). The change adds the parameter-based check in the test help…
Full details: Title check

Explanation

The title names the change: the test now detects client function calls on Vaadin 25.4. The raw summary confirms the test helper now also checks the first parameter of a queued JavaScript call, which matches the linked issue's request. The prefix "test:" fits the change, which only touches a test file. The title is short, specific, and does not describe unrelated work.

Full details: Linked Issues check

Explanation

Issue #48 requires that SimpleTimerClientCallsTest.resumingOnAttachSyncsOnce pass on every supported Vaadin version. It suggests also checking getInvocation().getParameters(). At the reviewed head, SimpleTimerClientCallsTest.calls(...) returns true when the expression contains the function name or when the first parameter equals that name. count(...) uses this predicate. resumingOnAttachSyncsOnce asserts count(flush(), "_sync") equals 1, so it now matches the Vaadin 25.4 call shape described in #48. The removingDisplayWhileTimerIsDetachedClearsIt test also uses the same predicate for "_unbindDisplay". The PR reports runs against Vaadin 14, 23, 24, 25.1 and 25.4.0-alpha6. I did not execute the test suite, so the cross-version result rests on the author's report. The add-on code is unchanged, which matches the issue statement that the add-on is unaffected.

Full details: Out of Scope Changes check

Explanation

The whole-PR change set (merge base 2995747 to head 139d9cc) touches only SimpleTimerClientCallsTest.java, per the supplied summary (+12/-3). The change adds the parameter-based check in the test helper and updates its Javadoc. Both changes directly support the fix for #48. No production code, build configuration, or unrelated test changes appear in the supplied evidence. The diff tool could not return a text diff, so this verdict relies on the reviewed head file contents and the supplied summary.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c0f7f45e-b670-463d-8177-1c038a947bc7
Commits

Reviewing files that changed from the base of the PR and between 2995747 and 139d9cc.

Files selected for processing: 1

  • src/test/java/com/flowingcode/vaadin/addons/simpletimer/SimpleTimerClientCallsTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@sonarqubecloud

Copy link
Copy Markdown

@paodb
paodb marked this pull request as ready for review November 16, 2026 17:05
@paodb
paodb requested a review from scardanzan November 16, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Do

Development

Successfully merging this pull request may close these issues.

SimpleTimerClientCallsTest fails against Vaadin 25.4

1 participant