25 lines
687 B
Dart
25 lines
687 B
Dart
import 'package:cyberhybridhub/widgets/spelling_question_placeholder.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
|
|
void main() {
|
|
testWidgets('SpellingQuestionPlaceholder shows retry', (tester) async {
|
|
var retried = false;
|
|
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: Scaffold(
|
|
body: SpellingQuestionPlaceholder(
|
|
onRetry: () => retried = true,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
|
|
expect(find.text('No spelling question ready'), findsOneWidget);
|
|
await tester.tap(find.byKey(const Key('spelling-placeholder-retry')));
|
|
await tester.pump();
|
|
expect(retried, isTrue);
|
|
});
|
|
}
|