wake-alarm/phone_app/test/text_free_sync_test.dart
Krzysztof kuhy Rudnicki 52c3ff5f1e
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Make wake-alarm text-free (textgate-rework)
Todo: 364208fc
2026-11-11 12:45:10 +01:00

47 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:sync_settings_ui/sync_settings_ui.dart';
import 'package:wake_alarm_sync/ui/theme.dart';
import 'text_free_support.dart';
/// The Settings sync row opens the shared `sync_settings_ui` screen; it is
/// part of what kuhy sees, so the textgate guard covers it too.
Widget _syncScreen({required bool googleAvailable}) => MaterialApp(
theme: buildAppTheme(),
home: SyncSettingsScreen(
accountLoader: () async => null,
accountSaver: (_) async {},
accountClearer: () async {},
sessionProbe: () async => false,
firebaseFactory: () async => null,
googleFirebaseFactory: () async => null,
googleAvailable: googleAvailable,
),
);
void main() {
for (final google in [true, false]) {
testWidgets('SyncSettingsScreen (google: $google) has no words', (
tester,
) async {
phoneView(tester);
await tester.pumpWidget(_syncScreen(googleAvailable: google));
await tester.pumpAndSettle();
expectNoWords(tester, 'SyncSettingsScreen');
});
}
testWidgets('SyncSettingsScreen expanded password form has no words', (
tester,
) async {
phoneView(tester);
await tester.pumpWidget(_syncScreen(googleAvailable: false));
await tester.pumpAndSettle();
await tester.tap(find.byType(ExpansionTile));
await tester.pumpAndSettle();
expect(find.byType(TextField), findsWidgets);
expectNoWords(tester, 'SyncSettingsScreen-expanded');
});
}