mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-08-26 23:16:42 +00:00
extended logbook integration test
This commit is contained in:
parent
b2a9481243
commit
357ee76937
2 changed files with 10 additions and 4 deletions
|
@ -28,8 +28,8 @@ void testLogbook(String description) {
|
||||||
description,
|
description,
|
||||||
(tester) async {
|
(tester) async {
|
||||||
await tester.pumpApplication(
|
await tester.pumpApplication(
|
||||||
equipmentProfiles: {},
|
selectedEquipmentProfileId: mockEquipmentProfiles.first.id,
|
||||||
predefinedFilms: mockFilms.toTogglableMap(),
|
selectedFilmId: mockFilms.first.id,
|
||||||
customFilms: {},
|
customFilms: {},
|
||||||
);
|
);
|
||||||
await tester.takePhoto();
|
await tester.takePhoto();
|
||||||
|
@ -45,6 +45,9 @@ void testLogbook(String description) {
|
||||||
await tester.tap(find.byType(LogbookPhotoGridTile).first);
|
await tester.tap(find.byType(LogbookPhotoGridTile).first);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
await tester.ensureVisible(find.text(mockEquipmentProfiles.first.name));
|
||||||
|
await tester.ensureVisible(find.text(mockFilms.first.name));
|
||||||
|
|
||||||
/// Add a note, select aperture value and shutter speed value
|
/// Add a note, select aperture value and shutter speed value
|
||||||
await tester.enterText(
|
await tester.enterText(
|
||||||
find.descendant(
|
find.descendant(
|
||||||
|
@ -58,6 +61,9 @@ void testLogbook(String description) {
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
await tester.openPickerAndSelect<ApertureValue>(S.current.apertureValue, 'f/5.6');
|
await tester.openPickerAndSelect<ApertureValue>(S.current.apertureValue, 'f/5.6');
|
||||||
await tester.openPickerAndSelect<ShutterSpeedValue>(S.current.shutterSpeedValue, '1/125');
|
await tester.openPickerAndSelect<ShutterSpeedValue>(S.current.shutterSpeedValue, '1/125');
|
||||||
|
await tester.openPickerAndSelect<EquipmentProfile>(S.current.equipmentProfile, S.current.notSet);
|
||||||
|
await tester.openPickerAndSelect<Film>(S.current.film, S.current.notSet);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
/// Save the edits
|
/// Save the edits
|
||||||
await tester.tap(find.byIcon(Icons.save_outlined));
|
await tester.tap(find.byIcon(Icons.save_outlined));
|
||||||
|
@ -101,7 +107,7 @@ extension on WidgetTester {
|
||||||
await tap(find.text(title));
|
await tap(find.text(title));
|
||||||
await pumpAndSettle();
|
await pumpAndSettle();
|
||||||
final dialogFinder = find.byType(DialogPicker<Optional<V>>);
|
final dialogFinder = find.byType(DialogPicker<Optional<V>>);
|
||||||
final listTileFinder = find.text(valueToSelect);
|
final listTileFinder = find.descendant(of: dialogFinder, matching: find.text(valueToSelect));
|
||||||
await scrollUntilVisible(
|
await scrollUntilVisible(
|
||||||
listTileFinder,
|
listTileFinder,
|
||||||
56,
|
56,
|
||||||
|
|
|
@ -269,7 +269,7 @@ class _EquipmentProfilePickerListTile extends StatelessWidget {
|
||||||
builder: (context, state) => PickerListTile(
|
builder: (context, state) => PickerListTile(
|
||||||
icon: Icons.camera_alt_outlined,
|
icon: Icons.camera_alt_outlined,
|
||||||
title: S.of(context).equipmentProfile,
|
title: S.of(context).equipmentProfile,
|
||||||
values: EquipmentProfiles.of(context),
|
values: EquipmentProfiles.of(context).skip(1).toList(growable: false),
|
||||||
selectedValue: EquipmentProfiles.of(context).firstWhereOrNull((e) => e.id == state.equipmentProfileId),
|
selectedValue: EquipmentProfiles.of(context).firstWhereOrNull((e) => e.id == state.equipmentProfileId),
|
||||||
titleAdapter: (value) => value.name,
|
titleAdapter: (value) => value.name,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
|
|
Loading…
Reference in a new issue