import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:garden_planner/widgets/content_widgets/new_beet_row.dart'; void main() { testWidgets('NewBeetRow butten press ', (WidgetTester tester) async { bool newRowPressed = false; await tester.pumpWidget( MaterialApp( home: Scaffold( body: NewBeetRow( onNewRow: () { newRowPressed = true; }, ), ), ), ); final buttonFinder = find.byType(ElevatedButton); await tester.tap(buttonFinder); expect(newRowPressed, true, reason: 'Button should execute command'); }); }