Skip to content

Commit cce2974

Browse files
Merge pull request #22 from gitautoai/gitauto/issue-21-20250227-000754
GitAuto: Add a widget test for lib/components/badge/gf_icon_badge.dart
2 parents 317b9b2 + 0140d68 commit cce2974

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_test/flutter_test.dart';
3+
import 'package:getwidget/getwidget.dart';
4+
5+
void main() {
6+
testWidgets('GFIconBadge widget test', (WidgetTester tester) async {
7+
await tester.pumpWidget(MaterialApp(
8+
home: Scaffold(
9+
body: GFIconBadge(
10+
child: Icon(Icons.star),
11+
counterChild: Text('3', style: TextStyle(color: Colors.white, fontSize: 12)),
12+
position: GFBadgePosition.topEnd(),
13+
),
14+
),
15+
));
16+
17+
expect(find.byType(GFIconBadge), findsOneWidget);
18+
expect(find.byIcon(Icons.star), findsOneWidget);
19+
expect(find.text('3'), findsOneWidget);
20+
});
21+
}

0 commit comments

Comments
 (0)