fix(app): 移除设置页调试服务器地址

This commit is contained in:
Zhou Weidong committed 2026-10-19 23:51:15 +08:00
1 parent 2b95c79931
commit 061aac6577
6 files changed
+25 -273

No files matched your search

+5 -27
View File
@@ -12,45 +12,23 @@ void main() {
InMemorySharedPreferencesAsync.empty();
});
testWidgets(
'should_show_server_settings_and_open_dialog_when_debug_tools_are_enabled',
(tester) async {
await _pumpFailureView(tester, showDebugTools: true);
final button = find.byKey(const Key('home-server-settings'));
expect(button, findsOneWidget);
expect(find.text('Server settings'), findsOneWidget);
await tester.tap(button);
await tester.pumpAndSettle();
expect(find.byKey(const Key('server-endpoint-input')), findsOneWidget);
expect(find.text('Restart the app to apply.'), findsOneWidget);
},
);
testWidgets('should_hide_server_settings_when_debug_tools_are_disabled', (
testWidgets('should_not_expose_server_settings_on_catalog_failure', (
tester,
) async {
await _pumpFailureView(tester, showDebugTools: false);
await _pumpFailureView(tester);
expect(find.byKey(const Key('home-server-settings')), findsNothing);
expect(find.text('Server settings'), findsNothing);
expect(find.text('Retry'), findsOneWidget);
});
}
Future<void> _pumpFailureView(
WidgetTester tester, {
required bool showDebugTools,
}) async {
Future<void> _pumpFailureView(WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
locale: const Locale('en'),
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: HomeFailureView(onRetry: () {}, showDebugTools: showDebugTools),
),
home: Scaffold(body: HomeFailureView(onRetry: () {})),
),
);
await tester.pumpAndSettle();