mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 15:30:59 +00:00
fixed animated dialog picker tests
This commit is contained in:
parent
e15d64b10f
commit
fce20c7154
3 changed files with 4 additions and 8 deletions
|
@ -118,11 +118,7 @@ class _DialogPickerState<T> extends State<DialogPicker<T>> {
|
||||||
),
|
),
|
||||||
const SizedBox(width: Dimens.grid16),
|
const SizedBox(width: Dimens.grid16),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () => widget.onSelect(_selectedValue),
|
||||||
if (widget.initialValue != _selectedValue) {
|
|
||||||
widget.onSelect(_selectedValue);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: Text(S.of(context).select),
|
child: Text(S.of(context).select),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
|
@ -101,7 +101,7 @@ extension WidgetTesterActions on WidgetTester {
|
||||||
);
|
);
|
||||||
expect(cancelButton, findsOneWidget);
|
expect(cancelButton, findsOneWidget);
|
||||||
await tap(cancelButton);
|
await tap(cancelButton);
|
||||||
await pumpAndSettle();
|
await pumpAndSettle(Dimens.durationML);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> tapCancelButton() async {
|
Future<void> tapCancelButton() async {
|
||||||
|
@ -110,6 +110,6 @@ extension WidgetTesterActions on WidgetTester {
|
||||||
);
|
);
|
||||||
expect(cancelButton, findsOneWidget);
|
expect(cancelButton, findsOneWidget);
|
||||||
await tap(cancelButton);
|
await tap(cancelButton);
|
||||||
await pumpAndSettle();
|
await pumpAndSettle(Dimens.durationML);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ void main() {
|
||||||
expect(find.byType(DialogPicker<IsoValue>), findsOneWidget);
|
expect(find.byType(DialogPicker<IsoValue>), findsOneWidget);
|
||||||
await tester.tapListTile(400);
|
await tester.tapListTile(400);
|
||||||
await tester.tapSelectButton();
|
await tester.tapSelectButton();
|
||||||
verifyNever(() => functions.onChanged(const IsoValue(400, StopType.full)));
|
verify(() => functions.onChanged(const IsoValue(400, StopType.full))).called(1);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue