Skip to content

Testing components which use a fetcher does not work with createRemixStub #7776

Closed as not planned
@KnisterPeter

Description

@KnisterPeter

What version of Remix are you using?

2.1.0

Are all your remix dependencies & dev-dependencies using the same version?

  • Yes

Steps to Reproduce

Create a simple remix app with a component using useFetcher.
Then write a test case using createRemixStub to test that component.

Expected Behavior

The component should render and eventually receive the loader data from the fetcher.

Actual Behavior

The initial state is rendered, the loader is called, but the loader data never reaches the fetcher.
The component is not re-rendered and the test fails.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions