reclaim/app/test/widget_test.dart
flemming-it 95b6642949 fix(ui): landing copy reflects real mode (live hub is the default)
The landing CTA hard-coded 'Demo-Modus' and 'Live-Hub-Anbindung folgt
in Woche 1' — stale now that live mode is the default and works. CTA
is just 'App öffnen'; the subtitle + version line read the resolved
repository.mode (Live-Hub / Hub offline / Demo-Modus). Verified
in-browser: opening the app fires 5 Submit RPCs (200) for the 5 live
norms over gRPC-web.

Signed-off-by: flemming-it <sf@flemming.it>
2026-06-19 02:53:34 +02:00

45 lines
1.4 KiB
Dart

// Smoke tests — boot the app, navigate to the shell, verify
// each rail destination renders without throwing.
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:reclaim_app/main.dart';
import 'package:reclaim_app/widgets/brand_wordmark.dart';
void main() {
// Generous surface so NavigationRail + Heatmap fit without
// overflow warnings.
const surfaceSize = Size(1400, 900);
setUp(() {
TestWidgetsFlutterBinding.ensureInitialized();
});
testWidgets('Landing renders brand mark + CTA',
(WidgetTester tester) async {
await tester.binding.setSurfaceSize(surfaceSize);
await tester.pumpWidget(const ReclaimApp());
await tester.pump();
expect(find.byType(BrandWordmark), findsWidgets);
expect(
find.widgetWithText(FilledButton, 'App öffnen'),
findsOneWidget,
);
await tester.pumpWidget(const SizedBox.shrink());
});
testWidgets('Tapping CTA reaches the shell and shows the heatmap',
(WidgetTester tester) async {
await tester.binding.setSurfaceSize(surfaceSize);
await tester.pumpWidget(const ReclaimApp());
await tester.pump();
await tester.tap(
find.widgetWithText(FilledButton, 'App öffnen'),
);
await tester.pump();
await tester.pump(const Duration(milliseconds: 600));
expect(find.text('Heatmap'), findsWidgets);
await tester.pumpWidget(const SizedBox.shrink());
});
}