feat(player): 点赞与评论改为按集

This commit is contained in:
Zhou Weidong committed 2026-10-21 16:15:29 +08:00
1 parent e6f34977f5
commit 83822a0cbb
25 files changed
+337 -69

No files matched your search

+33 -2
View File
@@ -239,6 +239,36 @@ void main() {
expect(repository.countCalls, ['5']);
});
testWidgets('should_scope_list_count_and_publish_to_episode', (tester) async {
final repository = FakeCommentRepository(
pages: [const CommentPage()],
countResult: 3,
publishResult: commentFixture(
id: '11',
content: 'Episode comment',
mine: true,
),
);
await _pumpSheet(tester, repository: repository, episodeId: 'episode-7');
expect(repository.pageCalls.single.episodeId, 'episode-7');
expect(repository.countEpisodeCalls, ['episode-7']);
await tester.tap(find.byKey(const Key('comment-input-placeholder')));
await tester.pumpAndSettle();
await tester.enterText(
find.byKey(const Key('comment-composer-input')),
'Episode comment',
);
await tester.pump();
await tester.tap(find.byKey(const Key('comment-composer-post')));
await tester.pumpAndSettle();
expect(repository.publishCalls.single.episodeId, 'episode-7');
expect(repository.countEpisodeCalls, ['episode-7', 'episode-7']);
});
testWidgets('should_fall_back_to_exact_count_when_server_total_fails', (
tester,
) async {
@@ -964,6 +994,7 @@ Future<AuthController> _pumpSheet(
required FakeCommentRepository repository,
FakeHaptics? haptics,
Locale locale = const Locale('en'),
String? episodeId,
}) async {
final auth = await _auth();
await tester.pumpWidget(
@@ -983,12 +1014,12 @@ Future<AuthController> _pumpSheet(
initialRoute: '/comments',
routes: {
'/': (_) => const Scaffold(backgroundColor: AppColors.ink),
'/comments': (_) => const Scaffold(
'/comments': (_) => Scaffold(
backgroundColor: AppColors.ink,
resizeToAvoidBottomInset: false,
body: Align(
alignment: Alignment.bottomCenter,
child: DramaCommentsSheet(drama: _drama),
child: DramaCommentsSheet(drama: _drama, episodeId: episodeId),
),
),
},