Skip to content

Types for queryByTestId not correct #135

Description

@ssylvia
  • dom-testing-library version: 3.11.2

Relevant code or config:

screen shot 2018-10-23 at 8 27 28 am

What you did:

Used queryByTestId in typescript

What happened:

VSCode gives error that more arguments are expected

Problem description:

Looks like queryByTestId uses the queryByAttribute type: https://github.com/kentcdodds/dom-testing-library/blob/master/typings/queries.d.ts#L52, even thought the attribute argument is automatically bound: https://github.com/kentcdodds/dom-testing-library/blob/master/src/queries.js#L153.

Suggested solution:

Add a new type or pick the keys off the queryByAttribute type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions