-
Notifications
You must be signed in to change notification settings - Fork 212
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
fix(settings): Add default text to several l10n.getString calls #12861
Conversation
expect(toggleButton).toHaveAttribute('aria-expanded', 'false'); | ||
expect(dropDown).not.toBeInTheDocument; | ||
expect(dropDown).not.toBeInTheDocument(); | ||
|
||
fireEvent.click(toggleButton); | ||
expect(toggleButton).toHaveAttribute('aria-expanded', 'true'); | ||
expect(dropDown).toBeInTheDocument; |
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.
I spent a few minutes trying to get some of these .toBeInTheDocument
tests changed to .toBeInTheDocument()
but I don't know why they're failing. I'll file a follow up issue to check all of our toBeInTheDocument
and toBeTruthy
calls across React tests because we have a few like that for some reason, which makes the tests look like they're passing when they aren't necessarily.
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.
follow up: #12868
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.
@LZoog Not sure why this broke?
l10n.getString( | ||
'avatar-page-delete-error-2', | ||
null, | ||
'There was a problem deleting your profile picture' |
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.
Probably needs a .
@LZoog Possibly this?
I've been trying to go through every result from git grep -n "l10n.getString" packages and verify it has 3 parameters, but wondering if there is a better way. Not sure how we could use a linter to enforce a method has 3 args (unless we do a lot of very scary AST work). |
@vbudhram I'm actually not sure why it was ever working. 😭 But I really wonder that too. It was always broken in Storybook. I don't see any changes in this train that would have caused it, or any changes on the l10n side. @pdehaan Ah nice find, I'll add the default text for that one too.
This is a good idea if we want to keep relying on fallback text, I'm going to add a comment to that spike (those are becoming my famous last words). |
I think I've sorted out why this happened. #12778 landed last train, which introduced a more correct Fluent strategy for Settings. I think prior to that fix, the entire page was rendering the strings from the FWIW, we have had other conversations around making our l10n approach consistent across packages as well as improvements, including potentially not relying on fallback text at all for React applications (we'll weigh pros/cons), in this spike. |
Because:
This commit:
fixes #12857
fixes #12858
fixes #12859
I started adding tests for all of these and then realized we were missing quite a few and some tests might take a bit longer to write. If you see something in particular feel free to call it out.
At the time of writing, without further investigation I don't know why these ever rendered correctly, we've been relying on fallback text for English for all of our strings and we even had tests to check for FTL IDs rendered rather than the English text.
Edit: see comment
This makes me eager to work on this spike, I think there's some l10n improvements we can make all around.