feat(app): 完善播放协议搜索与空状态

This commit is contained in:
Zhou Weidong committed 2026-10-23 12:38:47 +08:00
1 parent 671e0ce143
commit ef29fc5f15
85 files changed
+2976 -768

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
// Author: fruit.com.cn
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:fruitshorts/core/config/app_config.dart';
import 'package:fruitshorts/l10n/app_localizations.dart';
import 'package:fruitshorts/pages/settings/legal_links_card.dart';
void main() {
tearDown(AppConfig.clearRuntimeBaseUrl);
testWidgets('should_open_terms_and_privacy_for_the_current_language', (
tester,
) async {
AppConfig.applyRuntimeBaseUrl('http://192.168.31.243:8081/');
final opened = <String>[];
await tester.pumpWidget(
MaterialApp(
locale: const Locale('id'),
localizationsDelegates: AppLocalizations.localizationsDelegates,
supportedLocales: AppLocalizations.supportedLocales,
home: Scaffold(
body: LegalLinksCard(open: (url) async => opened.add(url)),
),
),
);
await tester.tap(find.byKey(const Key('settings-terms')));
await tester.tap(find.byKey(const Key('settings-privacy')));
await tester.pump();
expect(opened, [
'http://192.168.31.243:8081/terms/id',
'http://192.168.31.243:8081/privacy/id',
]);
});
}