2021-05-14 07:02:50 +00:00
|
|
|
import 'package:angel3_route/angel3_route.dart';
|
2017-03-17 17:36:04 +00:00
|
|
|
import 'package:test/test.dart';
|
|
|
|
|
2021-02-21 02:47:23 +00:00
|
|
|
void main() {
|
2019-11-28 17:40:32 +00:00
|
|
|
var router = Router<String>()
|
2018-08-20 18:59:51 +00:00
|
|
|
..chain(['a']).group('/b', (router) {
|
|
|
|
router.chain(['c']).chain(['d']).group('/e', (router) {
|
2017-03-17 17:36:04 +00:00
|
|
|
router.get('f', 'g');
|
|
|
|
});
|
|
|
|
})
|
|
|
|
..dumpTree();
|
|
|
|
|
|
|
|
test('nested route groups with chain', () {
|
2021-04-03 05:50:52 +00:00
|
|
|
var r = router.resolveAbsolute('/b/e/f').first.route;
|
2017-03-17 17:36:04 +00:00
|
|
|
expect(r, isNotNull);
|
|
|
|
expect(r.handlers, hasLength(4));
|
|
|
|
expect(r.handlers, equals(['a', 'c', 'd', 'g']));
|
|
|
|
});
|
|
|
|
}
|