Test fixes

This commit is contained in:
Sarah Jamie Lewis 2021-05-24 17:16:57 -07:00
parent 2394a1daaa
commit 3fcb0205bf
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -39,7 +39,7 @@ void main() {
home: Card(child: CwtchButtonTextField(
icon: Icon(Icons.bug_report_outlined),
tooltip: testingStr,
controller: ctrlr1,
controller: ctrlr1, onPressed: () { },
)),
);}
));

View File

@ -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);