Files
eatvio_app/test/features/diets/presentation/widgets/info_bouble_test.dart
2025-12-25 16:36:23 +03:00

40 lines
1.4 KiB
Dart

import 'package:eatvio_app/core/theme/theme_helper.dart';
import 'package:eatvio_app/features/diets/presentation/widgets/info_bouble.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('InfoBouble smoke', () {
Widget wrap(Widget child) {
return MaterialApp(
theme: ThemeHelper().themeData(),
home: Scaffold(body: child),
);
}
testWidgets('renders info bouble', (tester) async {
await tester.pumpWidget(wrap(const InfoBouble(children: [Text('Test')])));
await tester.pump();
expect(find.byType(InfoBouble), findsOneWidget);
expect(find.text('Test'), findsOneWidget);
});
testWidgets('renders info bouble with multiple children', (tester) async {
await tester.pumpWidget(wrap(const InfoBouble(children: [Icon(Icons.star), Text('Test')])));
await tester.pump();
expect(find.byType(InfoBouble), findsOneWidget);
expect(find.byIcon(Icons.star), findsOneWidget);
expect(find.text('Test'), findsOneWidget);
});
testWidgets('renders info bouble with custom background color', (tester) async {
await tester.pumpWidget(wrap(const InfoBouble(backgroundColor: Colors.blue, children: [Text('Test')])));
await tester.pump();
expect(find.byType(InfoBouble), findsOneWidget);
});
});
}