Files
mileograph_flutter/test/app_shell_test.dart
Pete Gregory 8cf43c76e2
Some checks failed
Release / meta (push) Successful in 11s
Release / linux-build (push) Successful in 8m31s
Release / release-dev (push) Has been cancelled
Release / release-master (push) Has been cancelled
Release / android-build (push) Has been cancelled
re add calculator page
2025-12-30 11:55:46 +00:00

20 lines
708 B
Dart

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'), 2);
expect(tabIndexForPath('/add'), 4);
});
test('tabIndexForPath ignores query when parsing uri', () {
expect(tabIndexForPath(Uri.parse('/trips?sort=desc').path), 2);
expect(tabIndexForPath(Uri.parse('/calculator/details?x=1').path), 1);
});
}