forked from eatvio/eatvio_app
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -1,39 +1,39 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
}
|
||||
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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user