Skip to content

waitForElementToBeRemoved is not expecting params on TS #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
MuraraAllan opened this issue Mar 18, 2020 · 1 comment
Closed

waitForElementToBeRemoved is not expecting params on TS #490

MuraraAllan opened this issue Mar 18, 2020 · 1 comment

Comments

@MuraraAllan
Copy link

MuraraAllan commented Mar 18, 2020

  • DOM Testing Library version:
  • node version:
  • npm (or yarn) version:

Relevant code or config:

  queryByPlaceholderText,
  getAllByPlaceholderText,
  getByPlaceholderText,
  findAllByPlaceholderText,
  findByPlaceholderText,
] = buildQueries(queryAllByPlaceholderText, getMultipleError, getMissingError)
looks like this abstraction is confusing TS, not sure although
await waitForElementToBeRemoved(getByPlaceholderText(t('auth.signin.fields.email.placeholder')) as any)

What you did:

I'm using typescript and testing-library, when trying to wait for an HTML Element to be removed, I need to pass hard-coded ```any`` type to the element, otherwise Typescript is gonna validate an invalid argument for the function.

What happened:

Argument of type 'HTMLElement' is not assignable to parameter of type '() => unknown'.
Type 'HTMLElement' provides no match for the signature '(): unknown'.ts(2345)

Reproduction:

Problem description:

Suggested solution:

@timdeschryver
Copy link
Member

This will get resolved when @types/: DefinitelyTyped/DefinitelyTyped#43102 gets merged.

If this is not the case, feel free to re-open this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants