// 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:lawheatmap_app/main.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 LawHeatmapApp()); await tester.pump(); expect(find.text('F∆I Law-Heatmap'), findsOneWidget); expect( find.widgetWithText(FilledButton, 'App öffnen (Demo-Modus)'), 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 LawHeatmapApp()); await tester.pump(); await tester.tap( find.widgetWithText(FilledButton, 'App öffnen (Demo-Modus)'), ); await tester.pump(); await tester.pump(const Duration(milliseconds: 600)); expect(find.text('Heatmap'), findsWidgets); await tester.pumpWidget(const SizedBox.shrink()); }); }