Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[go_router] Add await tester.pumpAndSettle() to verify
  • Loading branch information
koji-1009 committed Jul 26, 2022
commit 2ee5fd6b94869021ad5702b15736ada948e3d1b7
4 changes: 4 additions & 0 deletions packages/go_router/test/delegate_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ void main() {
);

goRouter.push('/a');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you do an await tester.pumpAndSettle() in between every push to verify it does not crash?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review, I fixed it in 2ee5fd6.

await tester.pumpAndSettle();

expect(goRouter.routerDelegate.matches.matches.length, 2);
expect(
goRouter.routerDelegate.matches.matches[1].pageKey,
const Key('/a-p1'),
);

goRouter.push('/a');
await tester.pumpAndSettle();

expect(goRouter.routerDelegate.matches.matches.length, 3);
expect(
goRouter.routerDelegate.matches.matches[2].pageKey,
Expand Down