5f59e17da8
Add flutter_background_geolocation for background location tracking on Android. Service automatically sends coordinates to server when app is in background. Error messages are shown as system notifications using flutter_local_notifications.
31 lines
1.1 KiB
Dart
31 lines
1.1 KiB
Dart
// This is a basic Flutter widget test.
|
|
//
|
|
// To perform an interaction with a widget in your test, use the WidgetTester
|
|
// utility in the flutter_test package. For example, you can send tap and scroll
|
|
// gestures. You can also use WidgetTester to find child widgets in the widget
|
|
// tree, read text, and verify that the values of widget properties are correct.
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
import 'package:family_safety_frontend/main.dart';
|
|
import 'package:family_safety_frontend/services/background_geo_service.dart';
|
|
import 'package:family_safety_frontend/services/settings_service.dart';
|
|
|
|
void main() {
|
|
testWidgets('App loads login screen', (WidgetTester tester) async {
|
|
final bgGeo = BackgroundGeoService();
|
|
await bgGeo.init();
|
|
await bgGeo.initNotifications();
|
|
await tester.pumpWidget(MyApp(
|
|
settingsService: SettingsService(),
|
|
bgGeo: bgGeo,
|
|
));
|
|
await tester.pump();
|
|
|
|
expect(find.text('Family Safety'), findsOneWidget);
|
|
expect(find.byType(TabBar), findsOneWidget);
|
|
expect(find.byType(ElevatedButton), findsOneWidget);
|
|
});
|
|
}
|