-
Notifications
You must be signed in to change notification settings - Fork 769
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Add validation for unfocus on empty space #19827
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a test to validate that a button loses focus when tapping on an empty space outside of it.
- Introduced a new test method "When_Tapped_Empty_Space" in FocusManager tests
- Configured the test to be ignored on platforms without input injector support
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_FocusManager.cs
Outdated
Show resolved
Hide resolved
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_FocusManager.cs
Show resolved
Hide resolved
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19827/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new UI test that validates focus behavior when tapping on an empty space outside a button. The key changes include:
- Removal of an extra empty line in the using directives.
- Addition of the test method "When_Tapped_Empty_Space" to verify that a button loses focus when the user taps outside it.
- Implementation of conditional test execution based on platform capabilities.
Comments suppressed due to low confidence (2)
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_FocusManager.cs:300
- [nitpick] Consider computing the tap coordinates relative to the button's position to reduce the risk of test fragility in different screen layouts or device scales.
TestServices.InputHelper.Tap(new(10, 10));
src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Input/Given_FocusManager.cs:279
- [nitpick] Consider renaming the test method to 'When_TappedOnEmptySpace' for improved readability.
public async Task When_Tapped_Empty_Space()
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19827/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19827/index.html |
764d311
to
64ebb2e
Compare
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19827/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19827/index.html |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
64ebb2e
to
77ef263
Compare
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-19827/index.html |
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-19827/index.html |
GitHub Issue (If applicable): closes #
PR Type
What kind of change does this PR introduce?
What is the current behavior?
What is the new behavior?
PR Checklist
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Run
results.Other information
Internal Issue (If applicable):