bubbletwist/test/widget_test.dart

25 lines
753 B
Dart
Raw Normal View History

2024-06-19 22:08:49 +02:00
// In the my_app_test.dart file
import 'package:bubbletwist/main.dart';
2024-04-24 16:21:26 +02:00
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
2024-06-19 22:08:49 +02:00
group('Bubble-Twist Widget Tests', () {
testWidgets('Initial startup shows start button',
(WidgetTester tester) async {
await tester.pumpWidget(const MyApp());
expect(find.text('Start'), findsOneWidget);
});
2024-04-24 16:21:26 +02:00
2024-06-19 22:08:49 +02:00
testWidgets('Game starts and displays grid on start button tap',
(WidgetTester tester) async {
await tester.pumpWidget(const MyApp());
await tester.tap(find.text('Start'));
await tester.pump();
2024-04-24 16:21:26 +02:00
2024-06-19 22:08:49 +02:00
// Ensure the GridView is now visible
expect(find.byType(GridView), findsOneWidget);
});
2024-04-24 16:21:26 +02:00
});
}