GardenPlanner/test/widgets/content_widgets/new_beet_row_test.dart

26 lines
675 B
Dart
Raw Normal View History

2023-06-25 10:13:39 +02:00
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');
});
}