mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-22 05:42:19 +01:00
Since the material_ui bump the app supplied no framework MaterialLocalizations, so crdt_sync_flutter's E2ePassphraseButton showDialog crashed and the phone stayed locked. Nothing synced and the PC fallback rang on 2026-11-16. The app now provides the localization delegates. Publish failures now reach logcat in release builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WzxdWWfb63jncj9Lca2jeX
29 lines
1.1 KiB
Dart
29 lines
1.1 KiB
Dart
// ignore: deprecated_member_use, the dialog under test is framework material.
|
|
import 'package:flutter/material.dart' as fw show AlertDialog;
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:material_ui/material_ui.dart';
|
|
import 'package:wake_alarm_sync/main.dart';
|
|
import 'package:wake_alarm_sync/screens/settings_screen.dart';
|
|
|
|
/// crdt_sync_flutter's passphrase dialog uses the framework's material
|
|
/// `showDialog`, which needs the framework's MaterialLocalizations. The
|
|
/// app's MaterialApp comes from material_ui and does not supply them.
|
|
void main() {
|
|
testWidgets('the settings lock icon opens the passphrase dialog', (
|
|
tester,
|
|
) async {
|
|
await tester.pumpWidget(const WakeAlarmSyncApp());
|
|
navigatorKey.currentState!.push(
|
|
MaterialPageRoute<void>(builder: (_) => const SettingsScreen()),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.tap(find.byKey(const Key('settings-e2e')));
|
|
await tester.pumpAndSettle();
|
|
|
|
expect(tester.takeException(), isNull);
|
|
expect(find.byType(fw.AlertDialog), findsOneWidget);
|
|
expect(find.byType(EditableText), findsOneWidget);
|
|
});
|
|
}
|