[READ ONLY MIRROR] Open Source TikTok alternative built on AT Protocol github.com/sprksocial/client
flutter atproto video dart
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

chore: trim unnecessary tests

+21 -53
+21 -53
test/src/core/design_system/templates/profile_page_template_test.dart
··· 6 6 7 7 void main() { 8 8 group('KnownFollowersSummary', () { 9 - testWidgets('hides when known followers are null', (tester) async { 10 - await tester.pumpWidget( 11 - _TestApp(child: KnownFollowersSummary(knownFollowers: null)), 12 - ); 9 + testWidgets('hides when there is no visible known follower', ( 10 + tester, 11 + ) async { 12 + final cases = <KnownFollowers?>[ 13 + null, 14 + const KnownFollowers(count: 0, followers: []), 15 + const KnownFollowers(count: 3, followers: []), 16 + ]; 13 17 14 - expect(find.textContaining('Followed by'), findsNothing); 15 - }); 16 - 17 - testWidgets('hides when count is zero', (tester) async { 18 - await tester.pumpWidget( 19 - _TestApp( 20 - child: KnownFollowersSummary( 21 - knownFollowers: const KnownFollowers(count: 0, followers: []), 18 + for (final knownFollowers in cases) { 19 + await tester.pumpWidget( 20 + _TestApp( 21 + child: KnownFollowersSummary(knownFollowers: knownFollowers), 22 22 ), 23 - ), 24 - ); 23 + ); 25 24 26 - expect(find.textContaining('Followed by'), findsNothing); 25 + expect(find.textContaining('Followed by'), findsNothing); 26 + } 27 27 }); 28 28 29 - testWidgets('hides when follower list is empty', (tester) async { 30 - await tester.pumpWidget( 31 - _TestApp( 32 - child: KnownFollowersSummary( 33 - knownFollowers: const KnownFollowers(count: 3, followers: []), 34 - ), 35 - ), 36 - ); 29 + testWidgets('shows one known follower and handles taps', (tester) async { 30 + var tapped = false; 37 31 38 - expect(find.textContaining('Followed by'), findsNothing); 39 - }); 40 - 41 - testWidgets('shows one known follower', (tester) async { 42 32 await tester.pumpWidget( 43 33 _TestApp( 44 34 child: KnownFollowersSummary( ··· 52 42 ), 53 43 ], 54 44 ), 45 + onTap: () => tapped = true, 55 46 ), 56 47 ), 57 48 ); 58 49 59 50 expect(find.text('Followed by Alice'), findsOneWidget); 51 + await tester.tap(find.text('Followed by Alice')); 52 + 53 + expect(tapped, isTrue); 60 54 }); 61 55 62 56 testWidgets('uses total count for others copy', (tester) async { ··· 83 77 ); 84 78 85 79 expect(find.text('Followed by Alice, Bob, and 3 others'), findsOneWidget); 86 - }); 87 - 88 - testWidgets('calls onTap when tapped', (tester) async { 89 - var tapped = false; 90 - 91 - await tester.pumpWidget( 92 - _TestApp( 93 - child: KnownFollowersSummary( 94 - knownFollowers: const KnownFollowers( 95 - count: 1, 96 - followers: [ 97 - ProfileViewBasic( 98 - did: 'did:plc:alice', 99 - handle: 'alice.sprk.so', 100 - displayName: 'Alice', 101 - ), 102 - ], 103 - ), 104 - onTap: () => tapped = true, 105 - ), 106 - ), 107 - ); 108 - 109 - await tester.tap(find.text('Followed by Alice')); 110 - 111 - expect(tapped, isTrue); 112 80 }); 113 81 }); 114 82 }