27 lines
733 B
Dart
27 lines
733 B
Dart
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(
|
|
MaterialApp(
|
|
home: Scaffold(
|
|
|
|
body: MyToDoIcon (
|
|
Icon(Icons.check),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
|
|
// Verify that the red dot is present
|
|
expect(find.byIcon(Icons.brightness_1), findsOneWidget);
|
|
// paints => verifys that a widget paints a certain shape or color v^1.15.30
|
|
expect(find.byIcon(Icons.brightness_1).first, paints..circle(color: Colors.redAccent));
|
|
});
|
|
}
|