A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
Current behavior:
When running an E2E test on a component, if that component contains nested render functions, then snapshot tests will come back with a skeleton element that provides no useful data for testing.
Expected behavior:
When we snapshot test components, we want to see the internal elements that are rendered, just as we can see the internal elements of the parent render function. Unit tests are working fine and some components have no issues with snapshot tests, but coverage on all necessary components would be nice.
Steps to reproduce:
Here is a render() functions that's provided me with empty elements, as well as the snapshot test structure I use.
exports[`xComponent should match snapshot 1`] = `"<div></div>"`;
Other information:
There's no stack trace since there's no real error going on, but I am positive that the source of the issue is the nested render functions. I've tried modifying the test in multiple ways to point at different names of the element and outer/inner html but all to no avail, I either get a null error or an empty element.
I appreciate any assistance and sorry I can't just copy and dump all my code here, as I have around 5 examples total that don't work. If you need any more information I will be watching this thread with great interest.
This should be fixed in the latest version. If it's still a problem, would you be able to create an issue with a thorough description on how to replicate this? Thanks
Stencil version:
I'm submitting a: [x] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/
Current behavior: When running an E2E test on a component, if that component contains nested render functions, then snapshot tests will come back with a skeleton element that provides no useful data for testing.
For instance, a class that contains:
will return as a snapshot:
Apologies that more detailed code can't be provided, since it's company code and I can't share it.
Here are some errors that are printed to console as well, they print under the test that just "passed".
Expected behavior: When we snapshot test components, we want to see the internal elements that are rendered, just as we can see the internal elements of the parent render function. Unit tests are working fine and some components have no issues with snapshot tests, but coverage on all necessary components would be nice.
Steps to reproduce: Here is a render() functions that's provided me with empty elements, as well as the snapshot test structure I use.
Snapshot test general structure:
An example that would give a skeleton snapshot:
would return:
Other information: There's no stack trace since there's no real error going on, but I am positive that the source of the issue is the nested render functions. I've tried modifying the test in multiple ways to point at different names of the element and outer/inner html but all to no avail, I either get a null error or an empty element.
I appreciate any assistance and sorry I can't just copy and dump all my code here, as I have around 5 examples total that don't work. If you need any more information I will be watching this thread with great interest.