main
1import 'package:blood_pressure_app/components/confirm_deletion_dialoge.dart';
2import 'package:flutter/material.dart';
3import 'package:blood_pressure_app/l10n/app_localizations.dart';
4import 'package:flutter_test/flutter_test.dart';
5
6import '../util.dart';
7
8void main() {
9 testWidgets('shows entire content', (tester) async {
10 await loadDialoge(tester, showConfirmDeletionDialoge);
11 await tester.pumpAndSettle();
12 expect(find.byType(AlertDialog), findsOneWidget);
13 expect(find.descendant(
14 of: find.byType(AlertDialog),
15 matching: find.byType(TextButton),
16 ), findsOneWidget);
17 expect(find.bySubtype<ElevatedButton>(), findsOneWidget);
18
19 final localizations = await AppLocalizations.delegate.load(const Locale('en'));
20 expect(find.text(localizations.confirmDelete), findsOneWidget);
21 expect(find.text(localizations.confirmDeleteDesc), findsOneWidget);
22 expect(find.text(localizations.btnCancel), findsOneWidget);
23 expect(find.text(localizations.btnConfirm), findsOneWidget);
24
25 expect(find.descendant(
26 of: find.bySubtype<ElevatedButton>(),
27 matching: find.byIcon(Icons.delete_forever),
28 ), findsOneWidget);
29 expect(find.descendant(
30 of: find.bySubtype<ElevatedButton>(),
31 matching: find.text(localizations.btnConfirm),
32 ), findsOneWidget);
33 });
34}