Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

test: consolidate grid LitRenderer column ITs into one view#9792

Open
web-padawan wants to merge 2 commits into
mainvaadin/flow-components:mainfrom
chore/consolidate-grid-lit-renderer-itvaadin/flow-components:chore/consolidate-grid-lit-renderer-itCopy head branch name to clipboard
Open

test: consolidate grid LitRenderer column ITs into one view#9792
web-padawan wants to merge 2 commits into
mainvaadin/flow-components:mainfrom
chore/consolidate-grid-lit-renderer-itvaadin/flow-components:chore/consolidate-grid-lit-renderer-itCopy head branch name to clipboard

Conversation

@web-padawan

Copy link
Copy Markdown
Member

The grid IT module has two LitRenderer test setups: the dedicated GridLitRendererPage/GridLitRendererIT (route vaadin-grid/lit-renderer) and the older demo-style GridViewUsingTemplatesPage/GridViewUsingTemplatesIT (route vaadin-grid-it-demo/using-templates, a leftover from the old demo project structure). This keeps only the dedicated pair.

The demo pair covered LitRenderer features the dedicated view did not: the ${index} variable, computed and complex-object withProperty values, and @click event handlers that mutate the item via refreshItem/refreshAll. That test is moved into the dedicated page/IT before the demo pair is deleted, so no coverage is lost. The migrated grid uses a smaller data set (only the first rows are exercised) to keep the page light.

The existing grid now has an explicit id (lit-renderer-grid) so shouldEnterEditModeAfterReattach selects it by id rather than by DOM position, which is no longer stable now that the page hosts a second grid.

Verified: GridLitRendererIT passes (8 tests, 0 failures). No references to the removed route or element IDs remain.

Follow-up to #9787, #9788, #9790, #9791. Part of the grid vaadin-grid-it-demo/* demo-view consolidation.


🤖 Generated with Claude Code

Move the LitRenderer-columns showcase (index variable, computed and
complex withProperty, @click handlers mutating via refreshItem/refreshAll)
from the demo GridViewUsingTemplates page/IT into the dedicated
GridLitRendererPage/IT, then delete the demo pair. These exercise
LitRenderer features not covered by the existing render/switch/editor
tests, so nothing is dropped. Give the existing grid an explicit id so
the reattach test no longer depends on DOM order now that the page hosts
a second grid.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes — left 1 comment.

Finding
🧹 Comment describes the old Polymer on-click syntax, but the template below uses Lit @click.

.withProperty("address", Person::getAddress))
.setHeader("Address");

// You can set events handlers associated with the template. The syntax

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Comment describes the old Polymer on-click syntax, but the template below uses Lit @click.

The moved comment reads "The syntax follows the Polymer convention "on-event", such as "on-click"", yet the very next line binds the handler with Lit syntax: "<button @click=${handleUpdate}>...". The on-event form belonged to the old TemplateRenderer; LitRenderer uses @event.

The comment was already inaccurate in the deleted demo view, but this PR transplants it into GridLitRendererPage — the canonical LitRenderer example. A developer copying this reference example is told to use on-click, which does not work with LitRenderer. Fix by rewording to describe the @event (e.g. @click) syntax, or drop the comment.

GridLitRendererPage.java:122 · conventions · confirmed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed mention of syntax (comments are demo leftovers, will drop them later).

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.