fix navbar freezing fix
Some checks failed
Release / meta (push) Failing after 9s
Release / android-build (push) Has been skipped
Release / linux-build (push) Has been skipped
Release / release-dev (push) Has been skipped
Release / release-master (push) Has been skipped

This commit is contained in:
2025-12-17 17:41:09 +00:00
parent a9e0cdbe1b
commit 587933fa50
7 changed files with 182 additions and 63 deletions

20
test/app_shell_test.dart Normal file
View 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);
});
}