fix(player): 评论总数含回复并改用相对时间
This commit is contained in:
1 parent
22cb74ded4
commit
2659c29501
14 files changed
+212
-9
No files matched your search
@@ -142,6 +142,45 @@ void main() {
|
||||
expect(repository.pageCalls.last.cursor, '10');
|
||||
});
|
||||
|
||||
testWidgets('should_show_server_total_that_includes_replies', (tester) async {
|
||||
final repository = FakeCommentRepository(
|
||||
pages: [
|
||||
CommentPage(
|
||||
comments: [
|
||||
commentFixture(id: '10', content: 'Root one'),
|
||||
commentFixture(id: '11', content: 'Root two'),
|
||||
],
|
||||
),
|
||||
],
|
||||
countResult: 9,
|
||||
);
|
||||
|
||||
await _pumpSheet(tester, repository: repository);
|
||||
|
||||
expect(find.text('9 comments'), findsOneWidget);
|
||||
expect(repository.countCalls, ['5']);
|
||||
});
|
||||
|
||||
testWidgets('should_fall_back_to_exact_count_when_server_total_fails', (
|
||||
tester,
|
||||
) async {
|
||||
final repository = FakeCommentRepository(
|
||||
pages: [
|
||||
CommentPage(
|
||||
comments: [
|
||||
commentFixture(id: '10', content: 'Root one'),
|
||||
commentFixture(id: '11', content: 'Root two'),
|
||||
],
|
||||
),
|
||||
],
|
||||
countError: StateError('offline'),
|
||||
);
|
||||
|
||||
await _pumpSheet(tester, repository: repository);
|
||||
|
||||
expect(find.text('2 comments'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should_show_compact_empty_state_when_no_comments_exist', (
|
||||
tester,
|
||||
) async {
|
||||
@@ -185,6 +224,7 @@ void main() {
|
||||
final repository = FakeCommentRepository(
|
||||
pages: [const CommentPage()],
|
||||
publishResult: commentFixture(id: '11', content: 'Nice demo', mine: true),
|
||||
countResult: 1,
|
||||
);
|
||||
|
||||
await _pumpSheet(tester, repository: repository);
|
||||
@@ -197,6 +237,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(tester.widget<TextField>(input).focusNode?.hasFocus, isFalse);
|
||||
expect(repository.countCalls, ['5', '5']);
|
||||
});
|
||||
|
||||
testWidgets('should_use_polished_comment_sizes', (tester) async {
|
||||
|
||||
Reference in new issue
Block a user