-
Notifications
You must be signed in to change notification settings - Fork 85
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(box): css style properties passed as HTML attributes #7110
base: master
Are you sure you want to change the base?
Conversation
2a7954b
to
63fed7f
Compare
508f875
to
2d47a16
Compare
src/components/box/box.test.tsx
Outdated
); | ||
|
||
const box = screen.getByTestId("box"); | ||
expect(box).toHaveStyle(`width: 100px`); |
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.
suggestion(non-blocking): toHaveStyle
accepts an object with multiple values, so you could pass these in as one assertion. I'm OK with the way you've done it, though. Feel free to ignore this comment if you prefer your way 😄
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.
The indicated tests have been refactored.
removed the css properties from being passed directly to the styled component
2d47a16
to
8e2376d
Compare
Proposed behaviour
The
height
,width
,opacity
andcolor
are not being passed directly to theStyledBox
component but instead are placed in thecssProps
object, and then they are used inside theStyledBox
. This prevents the props from being applied to the HTML node directly.Playwright tests that were checking for the attribute being present on the node have been amended since the attribute is no longer present.
Current behaviour
The
height
,width
,opacity
andcolor
props are passed directly to theStyledBox
component which applies them directly to the HTML node.Checklist
d.ts
file added or updated if requiredQA
Additional context
Testing instructions