Release/v1.0.0 #1

Merged
jianghaifeng merged 128 commits from release/v1.0.0 into main 2026-10-19 13:42:16 +00:00
2 changed files with 40 additions and 5 deletions
Showing only changes of commit e1147cfcba - Show all commits

No files matched your search

+4 -5
View File
@@ -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(