vaadin / vaadin/browserless-test
ComboBox testers: no clear(), no custom value, and multi-select replaces instead of toggling
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1
- Forks
- 3
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 51
Description
Problem. Three things a user does with a ComboBox have no tester
representation.
No clear(). ComboBox implements HasClearButton, and emptying a field
is always available to the user (#168). ComboBoxTester.selectItem(null) is the
only route, which reads as "select nothing" rather than "the user cleared it",
and MultiSelectComboBoxTester has no equivalent at all.
No custom value entry. setAllowCustomValue(true) +
addCustomValueSetListener is a core ComboBox feature — the user types
something that isn't in the list and the app decides what to do with it. There
is no way to fire CustomValueSetEvent, so that whole branch of application
code is untestable.
comboBox.setAllowCustomValue(true);
comboBox.addCustomValueSetListener(e -> items.add(e.getDetail()));
// no tester method reaches this
MultiSelect replaces instead of toggles.
MultiSelectComboBoxTester.selectItem(String...) overwrites the whole
selection, so selecting a second item silently drops the first — but in the
browser each click toggles one chip. There is also no deselectItem, and no way
to remove a single chip via its ✕. MultiSelectListBoxTester gets this right:
selectItems adds to the existing selection and deselectItems removes.
Ask.
clear()on both combo box testers, consistent with #168.setCustomValue(String)(or similar) firingCustomValueSetEventwith
isFromClient() == true, throwing whenisAllowCustomValue()is false.- Make
MultiSelectComboBoxTester.selectItemadditive and adddeselectItem/
deselectAll, matchingMultiSelectListBoxTester.
The last one is a behavioural change and wants a release note.
Found while auditing the project against #153 / #168.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with ComboBoxTester and MultiSelectComboBoxTester, then compare their selection behavior with MultiSelectListBoxTester and the clear behavior discussed in #168. Verify clear, custom-value, additive selection, deselection, and client-event behavior, including rejection when custom values are disabled; document the multi-select behavior change in a release note.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100