Unable to work with routes using private types.
tomwyr opened this issue · comments
Tomasz Wyrowiński commented
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.
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).