I need an example of a method being unit tested which contains the Navigator.push method. For ex.
Method to test-:
Future<int> navigateToSecondRoute(BuildContext context){
answer = await Navigator.push(
context,
MaterialPageRoute<int>(
builder: (context) => const SecondRoute(),
),
).then((onValue) {
return onValue;
});
return answer;
}