We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Documentation describes how to use IModularNavigator to intercept navigation calls but I'm not sure how to test that the correct route was pushed.
IModularNavigator
class ModularNavigateMock extends Mock implements IModularNavigator {} ... testWidgets('delivery address list component (navigation)...', (tester) async { Modular.navigatorDelegate = ModularNavigateMock();; await tester.pumpWidget(...); await tester.tap(find.byType(InkWell).at(2)); await tester.pumpAndSettle(); expect(find.byType(EditAddressModal), findsOneWidget); });
The tap invokes this action:
void _onEditAddressTapped({required AddressDataModel addressModel}) { Modular.to.push( MaterialPageRoute<Null>( builder: (BuildContext context) { return EditAddressModal(addressModel: addressModel); }, fullscreenDialog: true), ); }
The test fails however if I use Navigator.of(context).push(...) and Mocktail's NavigatorObserver mock the test succeeds.
Navigator.of(context).push(...)
NavigatorObserver
Is there a way how to achieve this with Modular?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Documentation describes how to use
IModularNavigator
to intercept navigation calls but I'm not sure how to test that the correct route was pushed.The tap invokes this action:
The test fails however if I use
Navigator.of(context).push(...)
and Mocktail'sNavigatorObserver
mock the test succeeds.Is there a way how to achieve this with Modular?
The text was updated successfully, but these errors were encountered: