diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ca5e71..c698fdd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/test/match_test.dart b/test/match_test.dart index 23c87ec..821e5de 100644 --- a/test/match_test.dart +++ b/test/match_test.dart @@ -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'); + }); }); }