Skip to content

Unable to work with routes using private types.Β #68

@tomwyr

Description

@tomwyr

It seems to be unable to mock navigator interactions when code in tests depends on types that are not publicly visible.

It's not uncommon that the Flutter SDK uses internal types that cannot be used outside the sdk. E.g. trying to test that DropdownButton pushes a dropdown menu will throw due to the when method generic type param that cannot be stubbed.

image

Attempting the above will fail with:

Exception has occurred.
TestFailure (No matching calls. All calls: MockNavigator.canPop(), MockNavigator.push<_DropdownRouteResult<String>>(_DropdownRoute<String>(RouteSettings(none, null), animation: null))

Mock navigator should expose a way of working around internal types (or maybe there already is one that I'm unaware of).

Metadata

Metadata

Assignees

No one assigned

    Labels

    p3Issues that we currently consider unimportantwaiting for responseWaiting for follow up

    Type

    No type

    Projects

    Status

    Community

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions