From b04d1dba14d54ca3db91c242be22f88014041547 Mon Sep 17 00:00:00 2001 From: Bretton Date: Fri, 31 Oct 2025 00:41:00 -0700 Subject: [PATCH] test: update tests for PostCard and handle display changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- test/providers/feed_provider_test.dart | 21 ++++----------------- test/widgets/feed_screen_test.dart | 14 +++----------- 2 files changed, 7 insertions(+), 28 deletions(-) diff --git a/test/providers/feed_provider_test.dart b/test/providers/feed_provider_test.dart index 509f355..663b1d3 100644 --- a/test/providers/feed_provider_test.dart +++ b/test/providers/feed_provider_test.dart @@ -10,7 +10,6 @@ import 'feed_provider_test.mocks.dart'; // Generate mocks @GenerateMocks([AuthProvider, CovesApiService]) - void main() { group('FeedProvider', () { late FeedProvider feedProvider; @@ -201,9 +200,7 @@ void main() { }); test('should set hasMore to false when no cursor', () async { - final response = TimelineResponse( - feed: [_createMockPost()], - ); + final response = TimelineResponse(feed: [_createMockPost()]); when( mockApiService.getTimeline( @@ -309,9 +306,7 @@ void main() { }); test('should not load more if hasMore is false', () async { - final response = TimelineResponse( - feed: [_createMockPost()], - ); + final response = TimelineResponse(feed: [_createMockPost()]); when( mockApiService.getTimeline( @@ -439,20 +434,12 @@ FeedViewPost _createMockPost() { handle: 'test.user', displayName: 'Test User', ), - community: CommunityRef( - did: 'did:plc:community', - name: 'test-community', - ), + 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, - ), + stats: PostStats(score: 42, upvotes: 50, downvotes: 8, commentCount: 5), facets: [], ), ); diff --git a/test/widgets/feed_screen_test.dart b/test/widgets/feed_screen_test.dart index 572efbf..8072e12 100644 --- a/test/widgets/feed_screen_test.dart +++ b/test/widgets/feed_screen_test.dart @@ -288,7 +288,7 @@ void main() { await tester.pumpWidget(createTestWidget()); expect(find.text('c/test-community'), findsOneWidget); - expect(find.text('Posted by Test User'), findsOneWidget); + expect(find.text('@test.user'), findsOneWidget); }); testWidgets('should call loadFeed on init', (tester) async { @@ -338,20 +338,12 @@ FeedViewPost _createMockPost(String title) { handle: 'test.user', displayName: 'Test User', ), - community: CommunityRef( - did: 'did:plc:community', - name: 'test-community', - ), + 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, - ), + stats: PostStats(score: 42, upvotes: 50, downvotes: 8, commentCount: 5), facets: [], ), ); -- 2.51.2