-
Notifications
You must be signed in to change notification settings - Fork 82
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
Testing children passed to slot #63
Comments
Hi @angelsalazar. This is still currently a gap when testing your components. Hopefully when salesforce/lwc#1322 is released it will be possible to call Unfortunately, it will be a bit before that change makes it a production release and possible here. I'll leave this issue open so we can verify once the PR into LWC is merged. Until then your workaround of creating an additional test component is probably the best option. |
@trevor-bliss Is there any update to to support testing children passed to slots? |
Checking if there's any update to testing a component that uses slots? |
@trevor-bliss it seems the PR you mentioned is merged, is there any chance this will be solved any time soon? |
Any update on this issue and resolution or potential workaround? |
FYI @leobalter |
You can do this through mocking. Here's an example of doing it with the the standard |
Any update on this issue Team ? We have our own implementation of lightningModal, which in itself is an LWC, this component in called in the component we are writing tests to. Any input is highly appreciated, and many thanks for the great work :) |
If you are using native shadow DOM then you can use |
Summary
I wonder if this issue can be considered as a bug, but since I did not find a solution on the lwc docs I think it is.
is it possible to tests components that receives children using an slot element?
I have build a wizard component that I am not able to test because there is no way to pass the components as children.
Steps To Reproduce:
Expected result
there should be way to test components that receive children using slot or a way to set
the lwc:dom="manual" programatically.
Actual result
there is no way to test the case described above.
Additional information
My workaround to this issue was to create a test demo component that renders the wizard and its wizard steps, but I feel lwc library should provide a way to test this scenario.
The text was updated successfully, but these errors were encountered: