You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test: documentation for standalone component testing #31312
While investigating #30047, I discovered that testing with standalone components requires some special consideration. After reviewing the docs, it is intentional to split up lazy-loaded distribution types (dist and www) from dist-custom-elements output. I found that I couldn't reliably address the reporter's specific issue seen in their tests unless I understood this distinction
For more context: This issue had to do with the testing the delegation of aria attributes on ion-button and other button like elements. The delegation runs in the button's componentWillLoad via inheritAriaAttributes, which pulls aria-label off the host and copies it onto the inner button. What changed is that the standalone (custom-elements) build doesn't expose el.componentOnReady(), so any test that reads fixture.nativeElement before hydration sees the attr still sitting on the host and no inner button yet. Angular-18-lazy handed them el.componentOnReady() and papered over the timing, standalone doesn't.
The documentation could be updated to make this distinction clearer when building tests and what to do about it to structure tests.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
docs(testing): improve standalone testing documentation (ionic-team#3…
ionitron-bot commentedon Sep 9, 2026
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
docs(testing): improve standalone testing documentation (ionic-team#3…