Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
SchabanBo committed Oct 7, 2024
1 parent a71244b commit 90b8f4b
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 1.12.0

- add bottomSheet page type #155 by @miaosun009
- Full path matching is attempted when the child route cannot be matched #154 by @miaosun009

# 1.11.2

- Fix error that the routes will be deleted when `TemporaryQRouter` is closed.
Expand Down
34 changes: 34 additions & 0 deletions test/match_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,39 @@ void main() {
await QR.back();
printCurrentHistory();
});

testWidgets('#154', (tester) async {
QR.reset();
await tester.pumpWidget(AppWrapper([
QRoute(
path: '/',
builder: () => const Scaffold(body: WidgetOne()),
),
QRoute.withChild(
path: '/auth',
children: [
QRoute(
path: 'login',
builder: () => const Text("login"),
)
],
builderChild: (r) {
return Scaffold(body: r);
},
),
QRoute(
path: '/auth/home',
builder: () => const Text("home"),
),
]));
await QR.to('/auth/login');
await tester.pumpAndSettle();
expect(find.text('login'), findsOneWidget);
expectedPath('/auth/login');
await QR.to('/auth/home');
await tester.pumpAndSettle();
expect(find.text('home'), findsOneWidget);
expectedPath('/auth/home');
});
});
}

0 comments on commit 90b8f4b

Please sign in to comment.