vaadin / vaadin/browserless-test

GridTester has no way to deselect a row, and no Grid editor support

Open
#175 2 comments 0 reactions 0 assignees View on GitHub

A pull request for this has already been merged.

  • #187 by @totally-not-ai — merged
Dominant language
Java
Stars
1
Forks
3
Avg merge
1d 20h
Merged PRs (30d)
51

Description

Problem. GridTester has select(int), selectAll() and getSelected(),
but no way to undo a selection. In the browser a user deselects by
ctrl-clicking a selected row in multi-select mode, by clicking the row's
checkbox again, by unchecking the select-all header checkbox, or by clicking
the selected row in single-select mode.

var grid = new GridTester<>(component);
grid.select(0);
// no deselect(0), no deselectAll()

The Kotlin layer already has the pieces — Grid._select calls
deselectAll() internally for single-select before
selectionModel.selectFromClient(item).

While in there, two related gaps:

  • Grid editor. Grid.getEditor() — the user double-clicks a row, edits the
    buffered fields and saves or cancels. There is no tester support for any of
    it. GridProTester.setValue covers GridPro's inline editing, but not the
    plain Grid editor.
  • selectAll() doesn't consider
    setSelectAllCheckboxVisibility(HIDDEN), even though the Kotlin
    Grid._selectAll Javadoc claims it "fails if ... the select all checkbox is
    hidden". If the checkbox isn't rendered there is no way for the user to
    trigger it. (Worth deciding deliberately — this is the #168 question in
    reverse.)

Ask. Add deselect(int row) and deselectAll(), routed through the
selection model's from-client path like select(int) is. Decide on the
select-all-checkbox gate. Grid editor support can be split off if it's too big
for one PR.

Found while auditing the project against #153 / #168.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with GridTester.select(int), then compare the Kotlin Grid._select and Grid._selectAll paths and GridProTester.setValue for existing tester conventions. Decide the hidden select-all behavior and cover deselect(int), deselectAll(), and any included Grid editor support with tests; done means the client selection behavior and chosen checkbox rule are verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
testing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.