-
Notifications
You must be signed in to change notification settings - Fork 542
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(qwik): fix missing class attribute #1133
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
17539ea
to
a64d884
Compare
@@ -383,6 +383,8 @@ const componentMappers: { | |||
}), | |||
}; | |||
const properties = { ...block.properties }; | |||
if (block.id) properties['block-id'] = block.id; | |||
if (block.class) properties['class'] = block.class; |
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.
worth pointing out that this 2nd line did not add anything to snapshots. Is it redundant? Or do snapshot tests not cover the usecase for it?
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.
Yes that is the important bit. Will update the tests.
expect(mitosis.trim()).toEqual(dedent` | ||
import { For } from "@builder.io/mitosis"; | ||
|
||
export default function MyComponent(props) { | ||
return ( | ||
<For each={state.submenusItem.menuItems}> | ||
{(item, index) => ( | ||
<div | ||
block-id="builder-ID" | ||
class="class-id" | ||
css={{ | ||
padding: "2px", | ||
}} | ||
> | ||
text-content | ||
</div> | ||
)} | ||
</For> | ||
); | ||
} | ||
`); | ||
}); |
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 we use toMatchSnapshot
instead?
Description
Add a short description of:
This sort of information is useful for people reviewing the code, as well as anyone from the future trying to understand why changes were made or why a bug started happening.