diff --git a/test/widget_missing_config_popup_test.dart b/test/widget_missing_config_popup_test.dart new file mode 100644 index 0000000..a4c3f3d --- /dev/null +++ b/test/widget_missing_config_popup_test.dart @@ -0,0 +1,17 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_test/flutter_test.dart'; +import 'package:smoke_cess_app/widgets/missing_config_popup.dart'; + +void main() { + testWidgets('MissingConfigPopup displays title and text', (WidgetTester tester) async { + final String title = 'Missing Configuration'; + final String text = 'Please configure the app before using it.'; + + await tester.pumpWidget(MaterialApp( + home: MissingConfigPopup(title: title, text: text), + )); + + expect(find.text(title), findsOneWidget); + expect(find.text(text), findsOneWidget); + }); +} diff --git a/test/widget_todo_icon_test.dart b/test/widget_todo_icon_test.dart new file mode 100644 index 0000000..faefdbd --- /dev/null +++ b/test/widget_todo_icon_test.dart @@ -0,0 +1,26 @@ +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)); + }); +}