feat(app): 展示真实点赞与评论计数

This commit is contained in:
Zhou Weidong committed 2026-10-19 23:56:12 +08:00
1 parent 7b927c794e
commit dfc650456a
9 files changed
+123 -8

No files matched your search

+42
View File
@@ -147,6 +147,48 @@ void main() {
'Fallback Drama',
);
});
testWidgets('should_show_server_like_count_when_count_is_available', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
theme: AppTheme.dark(),
locale: const Locale('en'),
supportedLocales: AppLocalizations.supportedLocales,
localizationsDelegates: AppLocalizations.localizationsDelegates,
home: Builder(
builder: (context) => Scaffold(
body: HomeFeedOverlay(
l10n: AppLocalizations.of(context)!,
drama: _drama,
episode: const Episode(
id: 'count-episode',
number: 1,
title: 'Count Episode',
isFree: true,
),
liked: true,
likeCount: 128,
saved: false,
onLike: () {},
onSave: () {},
onComments: () {},
onShare: () {},
onEpisodes: () {},
onDownload: () {},
onClear: () {},
onSearch: () {},
),
),
),
),
);
await tester.pumpAndSettle();
expect(find.byKey(const Key('rail-like-count')), findsOneWidget);
expect(find.text('128'), findsOneWidget);
});
}
const _drama = Drama(