-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Remove Switch On/Off content #20487
Remove Switch On/Off content #20487
Conversation
Brings consistency with iOS and Android
Hey there @dotMorten! Thank you so much for your PR! Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
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.
Hi Morten,
You have different ways to validate it with tests.
On the one hand, you can create a DeviceTests here https://github.com/dotnet/maui/blob/main/src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.Windows.cs#L16
Using xUnit you can create a test similar to https://github.com/dotnet/maui/blob/main/src/Core/tests/DeviceTests/Handlers/Switch/SwitchHandlerTests.cs#L14 where with a method you access the ToggleSwitch and you validate that the OffContent and OnContent properties are null.
You can also create a UITest, creating a golden test where a reference snapshot is created and the test compares each screenshot pixel by pixel with the reference. Example:
VerifyScreenshot(); |
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.
Can you retarget this for net9.0?
@PureWeen Done! |
Needs some kind of testing, think a UITest with a screenshot is fine |
Added Device Test. |
Description of Change
Removes the default On/Off text on the Windows ToggleSwitch. This brings consistency with iOS and Android, and avoids issues with not being able to style the text.
Issues Fixed
Fixes #20486
I've validated the fix with the Sandbox app. I'd love to add some unit tests too, but need a little guidance wrt where to put that, and how to verify that it no longer renders the text.