test: update tests for PostCard and handle display changes

- Update feed_screen_test to expect @handle format
- Remove expectation for share button count
- Update test expectations for new UI structure
- All 15 FeedScreen widget tests passing

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Changed files
+7 -28
test
+4 -17
test/providers/feed_provider_test.dart
···
// Generate mocks
@GenerateMocks([AuthProvider, CovesApiService])
-
void main() {
group('FeedProvider', () {
late FeedProvider feedProvider;
···
});
test('should set hasMore to false when no cursor', () async {
-
final response = TimelineResponse(
-
feed: [_createMockPost()],
-
);
when(
mockApiService.getTimeline(
···
});
test('should not load more if hasMore is false', () async {
-
final response = TimelineResponse(
-
feed: [_createMockPost()],
-
);
when(
mockApiService.getTimeline(
···
handle: 'test.user',
displayName: 'Test User',
),
-
community: CommunityRef(
-
did: 'did:plc:community',
-
name: 'test-community',
-
),
createdAt: DateTime.parse('2025-01-01T12:00:00Z'),
indexedAt: DateTime.parse('2025-01-01T12:00:00Z'),
text: 'Test body',
title: 'Test Post',
-
stats: PostStats(
-
score: 42,
-
upvotes: 50,
-
downvotes: 8,
-
commentCount: 5,
-
),
facets: [],
),
);
···
// Generate mocks
@GenerateMocks([AuthProvider, CovesApiService])
void main() {
group('FeedProvider', () {
late FeedProvider feedProvider;
···
});
test('should set hasMore to false when no cursor', () async {
+
final response = TimelineResponse(feed: [_createMockPost()]);
when(
mockApiService.getTimeline(
···
});
test('should not load more if hasMore is false', () async {
+
final response = TimelineResponse(feed: [_createMockPost()]);
when(
mockApiService.getTimeline(
···
handle: 'test.user',
displayName: 'Test User',
),
+
community: CommunityRef(did: 'did:plc:community', name: 'test-community'),
createdAt: DateTime.parse('2025-01-01T12:00:00Z'),
indexedAt: DateTime.parse('2025-01-01T12:00:00Z'),
text: 'Test body',
title: 'Test Post',
+
stats: PostStats(score: 42, upvotes: 50, downvotes: 8, commentCount: 5),
facets: [],
),
);
+3 -11
test/widgets/feed_screen_test.dart
···
await tester.pumpWidget(createTestWidget());
expect(find.text('c/test-community'), findsOneWidget);
-
expect(find.text('Posted by Test User'), findsOneWidget);
});
testWidgets('should call loadFeed on init', (tester) async {
···
handle: 'test.user',
displayName: 'Test User',
),
-
community: CommunityRef(
-
did: 'did:plc:community',
-
name: 'test-community',
-
),
createdAt: DateTime.parse('2025-01-01T12:00:00Z'),
indexedAt: DateTime.parse('2025-01-01T12:00:00Z'),
text: 'Test body',
title: title,
-
stats: PostStats(
-
score: 42,
-
upvotes: 50,
-
downvotes: 8,
-
commentCount: 5,
-
),
facets: [],
),
);
···
await tester.pumpWidget(createTestWidget());
expect(find.text('c/test-community'), findsOneWidget);
+
expect(find.text('@test.user'), findsOneWidget);
});
testWidgets('should call loadFeed on init', (tester) async {
···
handle: 'test.user',
displayName: 'Test User',
),
+
community: CommunityRef(did: 'did:plc:community', name: 'test-community'),
createdAt: DateTime.parse('2025-01-01T12:00:00Z'),
indexedAt: DateTime.parse('2025-01-01T12:00:00Z'),
text: 'Test body',
title: title,
+
stats: PostStats(score: 42, upvotes: 50, downvotes: 8, commentCount: 5),
facets: [],
),
);