merge: 合并 K3 举报错误透传修复
This commit is contained in:
commit
e1147cfcba
2 files changed
+40
-5
No files matched your search
@@ -90,12 +90,11 @@ class CommentTile extends StatelessWidget {
|
||||
PopupMenuItem(
|
||||
value: _deleteAction,
|
||||
child: Text(l10n.deleteComment),
|
||||
)
|
||||
else
|
||||
PopupMenuItem(
|
||||
value: _reportAction,
|
||||
child: Text(l10n.reportComment),
|
||||
),
|
||||
PopupMenuItem(
|
||||
value: _reportAction,
|
||||
child: Text(l10n.reportComment),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user