4

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 2

3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks it worked for me, I was srucked from long time
This solution worked for me while testing LWC custom component using jest testing framework.
1

change the attribute to because it supports to kebab notation.

1 Comment

Yes, jest UI support kebab notation for HTML template & jest.js supports camel notation for javascipt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.