cpd_2022_zi/test/widget_tests/widget_todo_icon_test.dart

22 lines
550 B
Dart
Raw Normal View History

2023-03-06 15:50:36 +01:00
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:smoke_cess_app/widgets/todo_icon.dart';
void main() {
testWidgets('MyToDoIcon has a red dot', (WidgetTester tester) async {
// Build the widget tree
await tester.pumpWidget(
2023-03-06 18:36:10 +01:00
const MaterialApp(
2023-03-06 15:50:36 +01:00
home: Scaffold(
2023-03-06 18:36:10 +01:00
body: MyToDoIcon(
2023-03-06 15:50:36 +01:00
Icon(Icons.check),
),
),
),
);
// Verify that the red dot is present
expect(find.byIcon(Icons.brightness_1), findsOneWidget);
});
}