bubbletwist/test/widget_test.dart

25 lines
753 B
Dart

// In the my_app_test.dart file
import 'package:bubbletwist/main.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('Bubble-Twist Widget Tests', () {
testWidgets('Initial startup shows start button',
(WidgetTester tester) async {
await tester.pumpWidget(const MyApp());
expect(find.text('Start'), findsOneWidget);
});
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();
// Ensure the GridView is now visible
expect(find.byType(GridView), findsOneWidget);
});
});
}