mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-11 18:30:50 +00:00
24 lines
830 B
Dart
24 lines
830 B
Dart
![]() |
import 'package:appflowy/ai/ai.dart';
|
||
|
import 'package:flutter_test/flutter_test.dart';
|
||
|
import 'package:extended_text_field/extended_text_field.dart';
|
||
|
|
||
|
extension AppFlowyAITest on WidgetTester {
|
||
|
Future<void> enterTextInPromptTextField(String text) async {
|
||
|
// Wait for the text field to be visible
|
||
|
await pumpAndSettle();
|
||
|
|
||
|
// Find the ExtendedTextField widget
|
||
|
final textField = find.descendant(
|
||
|
of: find.byType(PromptInputTextField),
|
||
|
matching: find.byType(ExtendedTextField),
|
||
|
);
|
||
|
expect(textField, findsOneWidget, reason: 'ExtendedTextField not found');
|
||
|
|
||
|
final widget = element(textField).widget as ExtendedTextField;
|
||
|
expect(widget.enabled, isTrue, reason: 'TextField is not enabled');
|
||
|
|
||
|
testTextInput.enterText(text);
|
||
|
await pumpAndSettle(const Duration(milliseconds: 300));
|
||
|
}
|
||
|
}
|