fix(flutter): 透传举报本人评论错误

This commit is contained in:
Zhou Weidong committed 2026-10-17 15:29:18 +08:00
1 parent 9db6935308
commit 1488ee8f85
2 files changed
+40 -5

No files matched your search

@@ -273,6 +273,42 @@ void main() {
expect(find.text('Sign in to continue'), findsOneWidget);
expect(interactions.reports, isEmpty);
});
testWidgets('should_show_backend_message_when_reporting_own_comment', (
tester,
) async {
final repository = FakeCommentRepository(
pages: [
CommentPage(
comments: [
commentFixture(
id: '10',
content: 'My comment',
mine: true,
),
],
),
],
);
final interactions = FakeInteractionRepository()
..reportError = const ApiException(400, '不能举报自己发布的内容');
await _pumpSheet(
tester,
repository: repository,
interactions: interactions,
);
await tester.tap(find.byKey(const Key('comment-menu-10')));
await tester.pumpAndSettle();
expect(find.text('Delete comment'), findsOneWidget);
expect(find.text('Report comment'), findsOneWidget);
await tester.tap(find.text('Report comment'));
await tester.pumpAndSettle();
await tester.tap(find.byKey(const Key('report-submit')));
await tester.pumpAndSettle();
expect(find.text('不能举报自己发布的内容'), findsOneWidget);
});
}
Future<void> _pumpSheet(