MainActivity now makes the app's only start-up permission request and tells Dart when it finishes; the phone-location stream waits for that instead of asking in parallel, which made Android drop the location grant. The P3 simulator run passed, so the pre-P2 FlightControlPage, the pages only it used and its Settings toggle are gone. The app smoke test checks the home screen again instead of the login gate removed in July. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
18 lines
634 B
Dart
18 lines
634 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
|
|
import 'package:pilotvault_fly/main.dart';
|
|
|
|
void main() {
|
|
testWidgets('Opens on the home screen with no aircraft connected', (WidgetTester tester) async {
|
|
SharedPreferences.setMockInitialValues(<String, Object>{});
|
|
await tester.pumpWidget(const DjiSampleApp());
|
|
await tester.pump();
|
|
|
|
expect(find.text('No aircraft connected'), findsOneWidget);
|
|
expect(find.text('Connect aircraft'), findsOneWidget);
|
|
expect(find.byType(MaterialApp), findsOneWidget);
|
|
});
|
|
}
|