Files
eatvio_app/test/features/diets/presentation/widgets/info_bouble_test.dart

109 lines
2.6 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', () {
testWidgets('displays info bouble with children', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
children: [
Text('Test'),
Icon(Icons.star),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
expect(find.text('Test'), findsOneWidget);
expect(find.byIcon(Icons.star), findsOneWidget);
});
testWidgets('displays with custom background color', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
backgroundColor: Colors.blue,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom radius', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
radius: 20,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom padding', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
padding: EdgeInsets.all(16),
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
testWidgets('displays with custom mainAxisAlignment', (tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeHelper().themeData(),
home: const Scaffold(
body: InfoBouble(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text('Test'),
],
),
),
),
);
expect(find.byType(InfoBouble), findsOneWidget);
});
});
}