fix navbar freezing fix
This commit is contained in:
20
test/app_shell_test.dart
Normal file
20
test/app_shell_test.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mileograph_flutter/ui/app_shell.dart';
|
||||
|
||||
void main() {
|
||||
test('tabIndexForPath maps nested routes', () {
|
||||
expect(tabIndexForPath('/'), 0);
|
||||
expect(tabIndexForPath('/calculator'), 1);
|
||||
expect(tabIndexForPath('/calculator/details'), 1);
|
||||
expect(tabIndexForPath('/legs'), 2);
|
||||
expect(tabIndexForPath('/traction/12/timeline'), 3);
|
||||
expect(tabIndexForPath('/trips'), 4);
|
||||
expect(tabIndexForPath('/add'), 5);
|
||||
});
|
||||
|
||||
test('tabIndexForPath ignores query when parsing uri', () {
|
||||
expect(tabIndexForPath(Uri.parse('/trips?sort=desc').path), 4);
|
||||
expect(tabIndexForPath(Uri.parse('/calculator/details?x=1').path), 1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user