-
Notifications
You must be signed in to change notification settings - Fork 57
fix(shopping-lists): B2B-3845 Warning about invalid props being passed to html components #604
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
base: main
Are you sure you want to change the base?
Conversation
| alignItems, | ||
| textAlignLocation, | ||
| }: FlexItemProps) => ({ | ||
| const ignoreDollarProps = (prop: string): boolean => isPropValid(prop) && !prop.startsWith('$'); |
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.
Ignoring $ props is the pattern that StyledComponents follows by default.
|
|
||
| it('should keep checkbox selection even after the product Qty update', async () => { | ||
| vitest.mocked(useParams).mockReturnValue({ id: '272989' }); | ||
| const spy = vi.spyOn(console, 'error').mockImplementation(() => {}); |
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.
these spies where there to silence these issues, no longer required.
apps/storefront/src/pages/ShoppingListDetails/components/ReAddToCart.tsx
Outdated
Show resolved
Hide resolved
…d to html components Avoid passing invalid props through styled components directly to HTML components, doing so will trigger a WARNING.
f7243eb to
6d96574
Compare
| await waitForElementToBeRemoved(() => screen.queryByText(/loading/i)); | ||
|
|
||
| const rowOfLovelyBoots = screen.getByRole('row', { name: /Lovely boots/ }); | ||
| within(rowOfLovelyBoots).getByRole('checkbox').click(); |
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.
This and the .blur() underneath are throwing a "Not wrapped in an act" warning, replacing for userEvent.click and userEvent.tab which correctly wrap things in an act.
6d96574 to
f7243eb
Compare
bc-victor
left a comment
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.
seems like tests are still failing even after rerunning, also one very minor comment
| describe('Add to quote', () => { | ||
| it('add shopping list to draft quote', async () => { | ||
| vitest.mocked(useParams).mockReturnValue({ id: '272989' }); | ||
| // const spy = vi.spyOn(console, 'error').mockImplementation(() => {}); |
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.
lets delete this line
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.
oh, def. sorry...
Jira: B2B-3845
What/Why?
Fix warning about invalid props being passed to html components.
Avoid passing invalid props through styled components directly to HTML components, doing so will trigger a WARNING.
We do that using a filter for
@emotion/styledRollout/Rollback
Revert
Testing
Before:
After:
These warnings show up in the console in the browser and in some tests sometimes.