LWC test using jest testing framework throws error - unknown public property "smalldevicesize" of element

Viewed 695

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".

Here is the error screenshot

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.

change the attribute to because it supports to kebab notation.

Related