Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

find* methods does not work as expected? #82

@causztic

Description

@causztic
  • react-native
  • native-testing-library version: 5.0.1
  • jest-preset: @testing-library/react-native
  • react-native version: 16.12.0
  • node version: 11

Relevant code or config:

    const button = await findByTestId('button-id');
    fireEvent.press(button);
    const button = getByTestId('button-id');
    fireEvent.press(button);

What you did:

Hi, I am trying to use the find* methods to attempt to wait for an element to appear. The second block works but the first one doesn't. Shouldn't both be equivalent?

What happened:

I got the error here: : Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Timeout - Async callback was not invoked within the 5000ms timeout specified by jest.setTimeout.Error:

Reproduction:

In fact, I wasn't able to run the async method in the README - I get this error:
Screenshot 2019-11-18 at 6 16 28 PM

Problem description:

Both methods should work similarly because the Promise in the find implementation should resolve once the get* returns true

Can you help us fix this issue by submitting a pull request?

I can try if I have a direction how to fix this!

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