diff --git a/test/input_provider_test.dart b/test/provider/input_provider_test.dart similarity index 100% rename from test/input_provider_test.dart rename to test/provider/input_provider_test.dart diff --git a/test/timer_provider_test.dart b/test/provider/timer_provider_test.dart similarity index 100% rename from test/timer_provider_test.dart rename to test/provider/timer_provider_test.dart diff --git a/test/widget_test.dart b/test/widget_test.dart deleted file mode 100644 index ecf9aaf..0000000 --- a/test/widget_test.dart +++ /dev/null @@ -1,30 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:smoke_cess_app/main.dart'; - -void main() { - testWidgets('Counter increments smoke test', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that our counter starts at 0. - expect(find.text('0'), findsOneWidget); - expect(find.text('1'), findsNothing); - - // Tap the '+' icon and trigger a frame. - await tester.tap(find.byIcon(Icons.add)); - await tester.pump(); - - // Verify that our counter has incremented. - expect(find.text('0'), findsNothing); - expect(find.text('1'), findsOneWidget); - }); -} diff --git a/test/widget_drop_down_test.dart b/test/widgets/widget_drop_down_test.dart similarity index 87% rename from test/widget_drop_down_test.dart rename to test/widgets/widget_drop_down_test.dart index 999f125..a7f5f9f 100644 --- a/test/widget_drop_down_test.dart +++ b/test/widgets/widget_drop_down_test.dart @@ -5,7 +5,8 @@ import 'package:smoke_cess_app/providers/input_provider.dart'; import 'package:smoke_cess_app/widgets/drop_down.dart'; void main() { - testWidgets('DropDown should display items and update input model', (WidgetTester tester) async { + testWidgets('DropDown should display items and update input model', + (WidgetTester tester) async { // Define the list of items final items = ['Item 1', 'Item 2', 'Item 3']; @@ -28,16 +29,16 @@ void main() { expect(find.text(items[0]), findsOneWidget); // Tap the DropDown to open the menu - await tester.tap(find.byType(DropdownButtonFormField)); + await tester.tap(find.byType(DropDown)); await tester.pump(); // Verify that the menu displays the correct items for (final item in items) { - expect(find.text(item), findsOneWidget); + expect(find.text(item).first, findsOneWidget); } // Select the second item - await tester.tap(find.text(items[1])); + await tester.tap(find.text(items[1]).last); await tester.pump(); // Verify that the input model was updated with the selected item diff --git a/test/widget_elevated_card_test.dart b/test/widgets/widget_elevated_card_test.dart similarity index 97% rename from test/widget_elevated_card_test.dart rename to test/widgets/widget_elevated_card_test.dart index f5359fa..51e6242 100644 --- a/test/widget_elevated_card_test.dart +++ b/test/widgets/widget_elevated_card_test.dart @@ -48,7 +48,7 @@ void main() { final titleWidget = tester.widget(titleFinder); // Assert - expect(titleWidget.style?.fontSize, equals(20.0)); + expect(titleWidget.style?.fontSize, equals(16.0)); expect(titleWidget.style?.fontWeight, equals(FontWeight.bold)); }); diff --git a/test/widget_todo_icon_test.dart b/test/widgets/widget_todo_icon_test.dart similarity index 100% rename from test/widget_todo_icon_test.dart rename to test/widgets/widget_todo_icon_test.dart