From 357ee7693706506dd8c38d6b47f32f8ac74357d3 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Thu, 21 Aug 2025 12:19:33 +0200 Subject: [PATCH] extended logbook integration test --- integration_test/logbook_test.dart | 12 +++++++++--- .../screen_logbook_photo_edit.dart | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/integration_test/logbook_test.dart b/integration_test/logbook_test.dart index 332431f..922202f 100644 --- a/integration_test/logbook_test.dart +++ b/integration_test/logbook_test.dart @@ -28,8 +28,8 @@ void testLogbook(String description) { description, (tester) async { await tester.pumpApplication( - equipmentProfiles: {}, - predefinedFilms: mockFilms.toTogglableMap(), + selectedEquipmentProfileId: mockEquipmentProfiles.first.id, + selectedFilmId: mockFilms.first.id, customFilms: {}, ); await tester.takePhoto(); @@ -45,6 +45,9 @@ void testLogbook(String description) { await tester.tap(find.byType(LogbookPhotoGridTile).first); 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 await tester.enterText( find.descendant( @@ -58,6 +61,9 @@ void testLogbook(String description) { await tester.pumpAndSettle(); await tester.openPickerAndSelect(S.current.apertureValue, 'f/5.6'); await tester.openPickerAndSelect(S.current.shutterSpeedValue, '1/125'); + await tester.openPickerAndSelect(S.current.equipmentProfile, S.current.notSet); + await tester.openPickerAndSelect(S.current.film, S.current.notSet); + await tester.pumpAndSettle(); /// Save the edits await tester.tap(find.byIcon(Icons.save_outlined)); @@ -101,7 +107,7 @@ extension on WidgetTester { await tap(find.text(title)); await pumpAndSettle(); final dialogFinder = find.byType(DialogPicker>); - final listTileFinder = find.text(valueToSelect); + final listTileFinder = find.descendant(of: dialogFinder, matching: find.text(valueToSelect)); await scrollUntilVisible( listTileFinder, 56, diff --git a/lib/screens/logbook_photo_edit/screen_logbook_photo_edit.dart b/lib/screens/logbook_photo_edit/screen_logbook_photo_edit.dart index c2c6873..13c4e56 100644 --- a/lib/screens/logbook_photo_edit/screen_logbook_photo_edit.dart +++ b/lib/screens/logbook_photo_edit/screen_logbook_photo_edit.dart @@ -269,7 +269,7 @@ class _EquipmentProfilePickerListTile extends StatelessWidget { builder: (context, state) => PickerListTile( icon: Icons.camera_alt_outlined, 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), titleAdapter: (value) => value.name, onChanged: (value) {