Skip to content

test: add overlay opening tests for multi-select-combo-box - #12744

Open
web-padawan wants to merge 2 commits into
mainfrom
test/mscb-overlay-opening
Open

test: add overlay opening tests for multi-select-combo-box#12744
web-padawan wants to merge 2 commits into
mainfrom
test/mscb-overlay-opening

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Combo-box and time-picker each have an overlay-opening.test.js. Multi-select-combo-box had no equivalent, and no coverage for several ways the dropdown opens.

  • Added overlay-opening.test.js following the structure and test names of the two sibling files
  • Covered opening by a label click, an input click, a toggle button click, typed input, ArrowDown, ArrowUp and open()
  • Covered the autoOpenDisabled variants of those, and that the toggle button still opens
  • Covered that the overlay stays closed when disabled is set, and when items or filteredItems is empty or null

Read-only is left out because multi-select-combo-box opens while read-only to show the selected items, and readonly.test.js already covers that.

Type of change

  • Tests

🤖 Generated with Claude Code

Mirrors the files that combo-box and time-picker already have. The
component had no coverage for opening by a label or input click, the
arrow keys, open(), autoOpenDisabled, or an empty items array.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

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

Copy link
Copy Markdown

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
🧪 The opening disallowed block drops the helper and error message click cases that both sibling files have, hiding a real behavior difference

});
});

describe('opening disallowed', () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧪 The opening disallowed block drops the helper and error message click cases that both sibling files have, hiding a real behavior difference

Both sibling files assert that a click on the helper text or the error message does not open the dropdown. Those two tests are missing here, and the PR description does not mention the omission.

The reason they would not pass is worth a look: combo-box and time-picker both override _onHostClick to only open when the click path includes the label or the input field. Multi-select-combo-box has no such override, so a host click anywhere — helper text, error message — reaches the base implementation and opens the dropdown.

Either add the tests and fix the override, or state in the description that the divergence is intentional.

overlay-opening.test.js:125 · tests

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.

This will be fixed in #12739.

Opening on a chip click holds only because chips are slotted into the
input field element, which `composedPath()` sees but `contains()` does
not. The remove button relies on its own `stopPropagation()` instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@web-padawan
web-padawan force-pushed the test/mscb-overlay-opening branch from ecd1055 to 7e5b89c Compare September 11, 2026 13:38
@sonarqubecloud

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants