-
Notifications
You must be signed in to change notification settings - Fork 92
[DT-2854] add an integration test to make sure dark mode toggling works through localstorage #2752
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 re 8000 lated emails.
Already on GitHub? Sign in to your account
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -35,5 +35,6 @@ | |||
label={buttonText} | |||
icon={buttonIcon} | |||
on:click={cycleDarkModePreference} | |||
data-testid="dark-mode-icon-button" |
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.
Annotation: Since the aria-label changes when you press the button, getByRole doesn't work well without re-selecting over and over. By using testid, I can get the element once and use it throughout the test.
ea6d9c3
to
0bf1034
Compare
@@ -25,6 +25,7 @@ | |||
<div | |||
class="flex h-6 w-6 items-center after:absolute after:left-[calc(100%_+_1.5rem)] after:top-0 after:hidden after:h-8 after:items-center after:bg-slate-800 after:p-1 after:px-2 after:text-xs after:text-white after:content-[attr(data-tooltip)] group-data-[nav=closed]:hover:after:flex" | |||
data-tooltip={tooltip} | |||
aria-hidden="true" |
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.
Annotation: This icon is pure decoration / redundant information to a non-visual user. By aria-hiding it, the navigation button now has a clean accessible name.
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.
Very nice 🤘
Description & motivation 💭
A previous PR introduced the "System Default" dark mode setting. This didn't write correctly to local storage, and needed a fix, which is already merged. This PR tests that the fix is working.
Thanks team for already having a way to separate desktop and mobile test!
Thanks AI for the boilerplate and thanks @rossnelson for helping make it actually work. Humans rule!
Screenshots (if applicable) 📸
Design Considerations 🎨
Testing 🧪
How was this tested 👻
Steps for others to test: 🚶🏽♂️🚶🏽♀️
Checklists
Draft Checklist
Merge Checklist
Issue(s) closed
Docs
Any docs updates needed?