Skip to content

container has Element type instead of HTMLElemet #550

Closed

Description

@artaommahe

The container property, returned by render function from @testing-library/angular package has an Element type instead of HTMLElement. That triggers a type error trying to use it with logRoles that expects HTMLElement as a first argument

in angular package

  container: Element;

in core types
https://github.com/testing-library/react-testing-library/blob/590bc18a7f24e025d4154e228adda71452fdec9e/types/index.d.ts#L33

  Container extends RendererableContainer | HydrateableContainer = HTMLElement,

  container: Container

Activity

  1. timdeschryver commented on Nov 6, 2025

    @timdeschryver
    Member

    Good catch, feel free to open a PR with change.
    Do you consider this a breaking change?

  2. artaommahe commented on Nov 7, 2025

    @artaommahe
    ContributorAuthor

    here it is #551

    i guess it shouldn't be a breaking change, cause any place that expects container: Element should work fine with container: HTMLElement cause it extends Element interface 🤔

  3. added a commit that references this issue on Dec 12, 2025
    a46417e
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions