Test fixes
This commit is contained in:
parent
2394a1daaa
commit
3fcb0205bf
|
@ -46,7 +46,7 @@ import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
|||
and then use:
|
||||
|
||||
```
|
||||
Text(AppLocalizations.of(context).stringIdentifer),
|
||||
Text(AppLocalizations.of(context)!.stringIdentifer),
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
|
|
@ -39,7 +39,7 @@ void main() {
|
|||
home: Card(child: CwtchButtonTextField(
|
||||
icon: Icon(Icons.bug_report_outlined),
|
||||
tooltip: testingStr,
|
||||
controller: ctrlr1,
|
||||
controller: ctrlr1, onPressed: () { },
|
||||
)),
|
||||
);}
|
||||
));
|
||||
|
|
|
@ -27,7 +27,7 @@ void main() {
|
|||
tester.binding.window.physicalSizeTestValue = Size(800, 300);
|
||||
final TextEditingController ctrlr1 = TextEditingController();
|
||||
|
||||
Widget testWidget = CwtchTextField(controller: ctrlr1);
|
||||
Widget testWidget = CwtchTextField(controller: ctrlr1, validator: (value) { }, labelText: '',);
|
||||
|
||||
Widget testHarness = MultiProvider(
|
||||
providers:[getSettingsEnglishDark()],
|
||||
|
@ -76,7 +76,7 @@ void main() {
|
|||
if (number == null) return strFail2;
|
||||
return null;
|
||||
},
|
||||
onChanged: (value) => formKey.currentState.validate(),
|
||||
onChanged: (value) => formKey.currentState!.validate(),
|
||||
);
|
||||
|
||||
Widget testHarness = MultiProvider(
|
||||
|
@ -125,7 +125,7 @@ void main() {
|
|||
await tester.pumpAndSettle();
|
||||
|
||||
// empty string
|
||||
formKey.currentState.validate(); //(ctrlr1.clear() doesn't trigger validate like keypress does)
|
||||
formKey.currentState!.validate(); //(ctrlr1.clear() doesn't trigger validate like keypress does)
|
||||
await tester.pumpAndSettle();
|
||||
await expectLater(find.byWidget(testHarness), matchesGoldenFile(file('form_final')));
|
||||
expect(find.text(strFail1), findsOneWidget);
|
||||
|
|
Loading…
Reference in New Issue