While testing LWC in VSCode using jest script, unable to render custom LWC component, it throws an error- Unknown public property "smalldevicesize" of element . This is likely a typo on the corresponding attribute "smalldevicesize".
2 Answers
You are using a wrong attribute name smalldevicesize this should be small-device-size
Here is an example:
<lightning-layout-item small-device-size="">
Here is the Lightning Web Component documentation. I hope this should work.
2 Comments
Shailendra Modi
Thanks it worked for me, I was srucked from long time
Shailendra Modi
This solution worked for me while testing LWC custom component using jest testing framework.
change the attribute to because it supports to kebab notation.
1 Comment
Shailendra Modi
Yes, jest UI support kebab notation for HTML template & jest.js supports camel notation for javascipt.