Refresh the Flutter snapshot: UI-01 through UI-09, plus a fresh installable APK
Full UI redesign pass complete: persistent tab shell with an always-visible background map, Modern Professional Dark theme, monochrome dark map tiles, offline skeleton map, a shared GlassPanel/FloatingPill component kit, customizable HUD telemetry widgets, and the Map HUD / Plan & Route Planning / Rides History screen rebuilds. 374 tests passing, up from 316. The APK is a fresh release build (debug-signed, no release signing config exists yet). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012Xki7YAcc2TiN2PRZJ2tXr
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:rippr/src/app/providers.dart';
|
||||
import 'package:rippr/src/config/config.dart';
|
||||
import 'package:rippr/src/domain/models.dart';
|
||||
import 'package:rippr/src/hud/hud_metric.dart';
|
||||
import 'package:rippr/src/ui/settings/settings_screen.dart';
|
||||
import 'package:rippr/src/ui/theme.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -196,6 +197,46 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
group('Live HUD stats (UI-04)', () {
|
||||
// The section sits at the bottom of a long ListView -- these rows are not built
|
||||
// until scrolled into view (a plain `ListView(children:)` still lazily materialises
|
||||
// via a sliver, same as `.builder`), so every test here scrolls first.
|
||||
Future<void> scrollTo(WidgetTester tester, Key key) => tester.scrollUntilVisible(
|
||||
find.byKey(key),
|
||||
200,
|
||||
scrollable: find.byType(Scrollable).first,
|
||||
);
|
||||
|
||||
testWidgets('a metric switch reflects and writes through to Config', (tester) async {
|
||||
await tester.pumpWidget(host());
|
||||
await tester.pumpAndSettle();
|
||||
await scrollTo(tester, const Key('hud-visible-maxSpeed'));
|
||||
|
||||
final initial = tester
|
||||
.widget<SwitchListTile>(find.byKey(const Key('hud-visible-maxSpeed')))
|
||||
.value;
|
||||
expect(initial, isFalse, reason: 'metrics beyond the fixed row start hidden');
|
||||
|
||||
await tester.tap(find.byKey(const Key('hud-visible-maxSpeed')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(config.hudLayout[HudMetric.maxSpeed]!.visible, isTrue,
|
||||
reason: 'the switch must write through to Config immediately, not wait '
|
||||
'for a HUD edit-mode session to end');
|
||||
});
|
||||
|
||||
testWidgets('a metric already visible by default shows as on', (tester) async {
|
||||
await tester.pumpWidget(host());
|
||||
await tester.pumpAndSettle();
|
||||
await scrollTo(tester, const Key('hud-visible-speed'));
|
||||
|
||||
final speedSwitch = tester
|
||||
.widget<SwitchListTile>(find.byKey(const Key('hud-visible-speed')))
|
||||
.value;
|
||||
expect(speedSwitch, isTrue);
|
||||
});
|
||||
});
|
||||
|
||||
testWidgets('shows a spinner rather than crashing while Config is still loading',
|
||||
(tester) async {
|
||||
await tester.pumpWidget(
|
||||
|
||||
Reference in New Issue
Block a user