Skip to content

test: documentation for standalone component testing #31312

Closed

Description

@Zac-Smucker-Bryan

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.

Activity

  1. added a commit that references this issue on Aug 10, 2026
    625f9c3
  2. ionitron-bot commented on Sep 9, 2026

    @ionitron-bot

    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.

  3. locked and limited conversation to collaborators on Sep 9, 2026
  4. added a commit that references this issue on Oct 3, 2026
    be8f07c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions