@@ -330,6 +330,46 @@ void main() {
330330 await tester.pumpAndSettle ();
331331 expect (find.text (errorTextField), findsOneWidget);
332332 });
333+ group ('Interact with FormBuilderField -' , () {
334+ testWidgets (
335+ 'Should show error when FormBuilder is disabled and FormBuilderField is always' ,
336+ (tester) async {
337+ const textFieldName = 'text4' ;
338+ const errorTextField = 'error text field' ;
339+ final testWidget = FormBuilderTextField (
340+ name: textFieldName,
341+ validator: (value) => errorTextField,
342+ autovalidateMode: AutovalidateMode .always,
343+ );
344+ await tester.pumpWidget (buildTestableFieldWidget (
345+ testWidget,
346+ autovalidateMode: AutovalidateMode .disabled,
347+ ));
348+ await tester.pumpAndSettle ();
349+
350+ expect (find.text (errorTextField), findsOneWidget);
351+ });
352+ // TODO: Enable when solve issue
353+ // https://github.com/flutter/flutter/issues/125766
354+ // testWidgets(
355+ // 'Should not show error when FormBuilder is always and FormBuilderField is disabled',
356+ // (tester) async {
357+ // const textFieldName = 'text4';
358+ // const errorTextField = 'error text field';
359+ // final testWidget = FormBuilderTextField(
360+ // name: textFieldName,
361+ // validator: (value) => errorTextField,
362+ // autovalidateMode: AutovalidateMode.disabled,
363+ // );
364+ // await tester.pumpWidget(buildTestableFieldWidget(
365+ // testWidget,
366+ // autovalidateMode: AutovalidateMode.always,
367+ // ));
368+ // await tester.pumpAndSettle();
369+
370+ // expect(find.text(errorTextField), findsNothing);
371+ // });
372+ });
333373 });
334374
335375 group ('isDirty - ' , () {
0 commit comments