Skip to content
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

LWC Autocomplete for component names in test files should use dashes #504

Open
randi274 opened this issue May 19, 2022 · 0 comments
Open
Labels

Comments

@randi274
Copy link
Contributor

randi274 commented May 19, 2022

Is your feature request related to a problem? Please describe.
In Jest files, to create an element you need to use the dashed name, not the component bundle name to create the element. The component bundle name is being provided, and it creates a compile error when autocomplete is used.

Describe the solution you'd like
When creating an element to test in a Jest file, we're providing an autocomplete with the lwcTypingsName, but this doesn't provide the dashed name that is semantically correct.

Describe alternatives you've considered
You can easily modify it once you've autocompleted. But it would be better if you didn't have to!

Additional context
From the LWC documentation: "Camel case component folder names map to kebab-case in markup.". Note the callout that underscores are also legal.

Here is the correctly formatted name with the list of incorrect autocompletes that we provide:
LWC Retry Weirdness

In the markup, the correct syntax would be: c-account-map -> currently works fine, is completed by the htmlCompletion from the VS Code HTML Language Service.
When importing a component (in regular JS file or the test), the correct syntax to import a method from another component would be: import { doSomething } from 'c/accountMap'; -> our current autocomplete is correct here.
When creating an element to test, the correct syntax would be: c-account-map .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant