mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-23 23:46:27 +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
962 B
Dart
29 lines
962 B
Dart
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:shared_preferences/shared_preferences.dart';
|
|
import 'package:wake_alarm_sync/services/session_publisher.dart';
|
|
|
|
import '../fake_secure_storage.dart';
|
|
|
|
void main() {
|
|
TestWidgetsFlutterBinding.ensureInitialized();
|
|
test('a failed publish reaches debugPrint, not only developer.log', () async {
|
|
SharedPreferences.setMockInitialValues({});
|
|
installFakeSecureStorage(initial: {'github_token': 'tok'});
|
|
final lines = <String>[];
|
|
final saved = debugPrint;
|
|
debugPrint = (message, {wrapWidth}) => lines.add('$message');
|
|
addTearDown(() => debugPrint = saved);
|
|
|
|
final status = await SessionPublisher(
|
|
open: () async => throw Exception('boom'),
|
|
).publish();
|
|
|
|
expect(status, 'Session kept locally (sync failed)');
|
|
expect(
|
|
lines.join('\n'),
|
|
contains('session publish failed: Exception: boom'),
|
|
);
|
|
});
|
|
}
|