Skip to content

test: extract and extend select focus related tests - #9575

Merged
web-padawan merged 1 commit into
mainfrom
test/select-focus-tests
Jun 30, 2025
Merged

web-padawan merged 1 commit into
mainfrom
test/select-focus-tests

Conversation

@web-padawan

@web-padawan web-padawan commented Jun 28, 2025 •

Copy link
Copy Markdown
Member

Description

Extracted and improved select focus tests in preparation for the upcoming native popover refactoring.

Type of change

  • Test

@web-padawan
web-padawan requested a review from vursen June 28, 2025 11:53
@sonarqubecloud

Copy link
Copy Markdown

});

it('should restore focused state on closing the overlay if phone', async () => {
select._phone = true;

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.

The closing logic specific to _phone has been removed in #3120 as part of an a11y fix, so there is no need for separate tests covering this mode anymore.

expect(focusedSpy.called).to.be.true;
});

it('should focus the button before moving the focus to next selectable element', async () => {

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.

Replaced this with better tests using sendKeys that actually ensure that focus is eventually moved to the first / last global focusable on overlay item Tab and Shift + Tab respectively.

@web-padawan
web-padawan merged commit c029881 into main Jun 30, 2025
@web-padawan
web-padawan deleted the test/select-focus-tests branch June 30, 2025 06:35
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