fixed integration tests

This commit is contained in:
Vadim 2025-09-10 09:33:20 +02:00
parent 7b46d4342c
commit a5f211ad4b
5 changed files with 35 additions and 36 deletions

View file

@ -173,7 +173,7 @@ void testLogbookEquipmentProfileChanges(String description) {
); );
_expectPickerListTileValue( _expectPickerListTileValue(
S.current.apertureValue, S.current.apertureValue,
'f/${mockPinholeEquipmentProfiles.first.aperture}', ApertureValue(mockPinholeEquipmentProfiles.first.aperture, StopType.full).toString(),
reason: 'Aperture value must be automatically set when selecting a pinhole profile', reason: 'Aperture value must be automatically set when selecting a pinhole profile',
); );
@ -204,7 +204,7 @@ void testLogbookEquipmentProfileChanges(String description) {
_expectPickerListTileValue( _expectPickerListTileValue(
S.current.apertureValue, S.current.apertureValue,
'f/${mockPinholeEquipmentProfiles[1].aperture}', ApertureValue(mockPinholeEquipmentProfiles[1].aperture, StopType.full).toString(),
reason: 'Aperture value must be updated when switching to a different pinhole profile', reason: 'Aperture value must be updated when switching to a different pinhole profile',
); );

View file

@ -59,7 +59,7 @@ void testToggleLayoutFeatures(String description) {
); );
expectExtremeExposurePairs( expectExtremeExposurePairs(
'f/1.0 - 1/320', 'f/1.0 - 1/320',
'f/45 - 6"', 'f/45 - 6s',
reason: 'Aperture and shutter speed ranges must be reset to default values when equipment profile is reset', reason: 'Aperture and shutter speed ranges must be reset to default values when equipment profile is reset',
); );
expectExposurePairsListItem( expectExposurePairsListItem(
@ -73,7 +73,7 @@ void testToggleLayoutFeatures(String description) {
expectExposurePairsListItem( expectExposurePairsListItem(
tester, tester,
'f/45', 'f/45',
'6"', '6s',
reason: reason:
'Aperture and shutter speed ranges must be reset to default values when equipment profile is reset.', 'Aperture and shutter speed ranges must be reset to default values when equipment profile is reset.',
); );
@ -92,10 +92,10 @@ void testToggleLayoutFeatures(String description) {
(tester) async { (tester) async {
await tester.pumpApplication(); await tester.pumpApplication();
await tester.takePhoto(); await tester.takePhoto();
expectExtremeExposurePairs('f/1.0 - 1/320', 'f/45 - 6"'); expectExtremeExposurePairs('f/1.0 - 1/320', 'f/45 - 6s');
expectExposurePairsListItem(tester, 'f/1.0', '1/320'); expectExposurePairsListItem(tester, 'f/1.0', '1/320');
await tester.scrollToTheLastExposurePair(); await tester.scrollToTheLastExposurePair();
expectExposurePairsListItem(tester, 'f/45', '6"'); expectExposurePairsListItem(tester, 'f/45', '6s');
// Disable layout feature // Disable layout feature
await tester.toggleLayoutFeature(S.current.meteringScreenFeatureExtremeExposurePairs); await tester.toggleLayoutFeature(S.current.meteringScreenFeatureExtremeExposurePairs);
@ -116,7 +116,7 @@ void testToggleLayoutFeatures(String description) {
expectExposurePairsListItem( expectExposurePairsListItem(
tester, tester,
'f/45', 'f/45',
'6"', '6s',
reason: reason:
'Exposure pairs list must not be affected by the visibility of the extreme exposure pairs container.', 'Exposure pairs list must not be affected by the visibility of the extreme exposure pairs container.',
); );
@ -125,7 +125,7 @@ void testToggleLayoutFeatures(String description) {
await tester.toggleLayoutFeature(S.current.meteringScreenFeatureExtremeExposurePairs); await tester.toggleLayoutFeature(S.current.meteringScreenFeatureExtremeExposurePairs);
expectExtremeExposurePairs( expectExtremeExposurePairs(
'f/1.0 - 1/320', 'f/1.0 - 1/320',
'f/45 - 6"', 'f/45 - 6s',
reason: reason:
'Exposure pairs list must not be affected by the visibility of the extreme exposure pairs container.', 'Exposure pairs list must not be affected by the visibility of the extreme exposure pairs container.',
); );
@ -138,10 +138,10 @@ void testToggleLayoutFeatures(String description) {
await tester.pumpApplication(selectedFilmId: mockFilms.first.id); await tester.pumpApplication(selectedFilmId: mockFilms.first.id);
await tester.takePhoto(); await tester.takePhoto();
expectPickerTitle<FilmPicker>(mockFilms.first.name); expectPickerTitle<FilmPicker>(mockFilms.first.name);
expectExtremeExposurePairs('f/1.0 - 1/320', 'f/45 - 12"'); expectExtremeExposurePairs('f/1.0 - 1/320', 'f/45 - 12s');
expectExposurePairsListItem(tester, 'f/1.0', '1/320'); expectExposurePairsListItem(tester, 'f/1.0', '1/320');
await tester.scrollToTheLastExposurePair(); await tester.scrollToTheLastExposurePair();
expectExposurePairsListItem(tester, 'f/45', '12"'); expectExposurePairsListItem(tester, 'f/45', '12s');
// Disable layout feature // Disable layout feature
await tester.toggleLayoutFeature(S.current.meteringScreenFeatureFilmPicker); await tester.toggleLayoutFeature(S.current.meteringScreenFeatureFilmPicker);
@ -153,7 +153,7 @@ void testToggleLayoutFeatures(String description) {
); );
expectExtremeExposurePairs( expectExtremeExposurePairs(
'f/1.0 - 1/320', 'f/1.0 - 1/320',
'f/45 - 6"', 'f/45 - 6s',
reason: 'Shutter speed must not be affected by reciprocity when film is discarded.', reason: 'Shutter speed must not be affected by reciprocity when film is discarded.',
); );
expectExposurePairsListItem( expectExposurePairsListItem(
@ -166,7 +166,7 @@ void testToggleLayoutFeatures(String description) {
expectExposurePairsListItem( expectExposurePairsListItem(
tester, tester,
'f/45', 'f/45',
'6"', '6s',
reason: 'Shutter speed must not be affected by reciprocity when film is discarded.', reason: 'Shutter speed must not be affected by reciprocity when film is discarded.',
); );

View file

@ -24,20 +24,19 @@ class DialogPicker<T> extends StatefulWidget {
} }
class _DialogPickerState<T> extends State<DialogPicker<T>> { class _DialogPickerState<T> extends State<DialogPicker<T>> {
late T _selected = widget.selectedValue; T? _selected;
final ScrollController _scrollController = ScrollController(); final ScrollController _scrollController = ScrollController();
bool _hasSelection = false;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
SchedulerBinding.instance.addPostFrameCallback((_) { final selectedIndex = widget.values.indexOf(widget.selectedValue);
final selectedIndex = widget.values.indexOf(_selected); if (selectedIndex >= 0) {
if (selectedIndex >= 0) { _selected = widget.selectedValue;
SchedulerBinding.instance.addPostFrameCallback((_) {
_scrollController.jumpTo((Dimens.grid56 * selectedIndex).clamp(0, _scrollController.position.maxScrollExtent)); _scrollController.jumpTo((Dimens.grid56 * selectedIndex).clamp(0, _scrollController.position.maxScrollExtent));
_hasSelection = true; });
} }
});
} }
@override @override
@ -95,7 +94,7 @@ class _DialogPickerState<T> extends State<DialogPicker<T>> {
child: Text(S.of(context).cancel), child: Text(S.of(context).cancel),
), ),
TextButton( TextButton(
onPressed: _hasSelection ? () => Navigator.of(context).pop(_selected) : null, onPressed: _selected != null ? () => Navigator.of(context).pop(_selected) : null,
child: Text(S.of(context).select), child: Text(S.of(context).select),
), ),
], ],

View file

@ -170,10 +170,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: built_value name: built_value
sha256: "082001b5c3dc495d4a42f1d5789990505df20d8547d42507c29050af6933ee27" sha256: a30f0a0e38671e89a492c44d005b5545b830a961575bbd8336d42869ff71066d
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "8.10.1" version: "8.12.0"
camera: camera:
dependency: "direct main" dependency: "direct main"
description: description:
@ -861,8 +861,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "feature/MLI-48" ref: main
resolved-ref: "4a169640bff3d3a3206a2c352a75cbcea4871b1c" resolved-ref: "3f5bae6d2500a746fb83ab345919095a815244d1"
url: "https://github.com/vodemn/m3_lightmeter_iap" url: "https://github.com/vodemn/m3_lightmeter_iap"
source: git source: git
version: "4.1.2+37" version: "4.1.2+37"
@ -870,11 +870,11 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: "feature/MLR-18" ref: "v2.5.0"
resolved-ref: "61bb3f8a9164d19f6e47c96fbea1cbe3aaf39fc3" resolved-ref: "680affb45c5d03ed4fe61c30ee0d6e6fab0f2c12"
url: "https://github.com/vodemn/m3_lightmeter_resources" url: "https://github.com/vodemn/m3_lightmeter_resources"
source: git source: git
version: "2.4.0+13" version: "2.5.0+14"
macros: macros:
dependency: transitive dependency: transitive
description: description:
@ -967,10 +967,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: package_info_plus_platform_interface name: package_info_plus_platform_interface
sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.2.0" version: "3.2.1"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -1119,10 +1119,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: provider name: provider
sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "6.1.5" version: "6.1.5+1"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -1524,10 +1524,10 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: watcher name: watcher
sha256: "0b7fd4a0bbc4b92641dbf20adfd7e3fd1398fe17102d94b674234563e110088a" sha256: "5bf046f41320ac97a469d506261797f35254fa61c641741ef32dacda98b7d39c"
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.2" version: "1.1.3"
web: web:
dependency: transitive dependency: transitive
description: description:

View file

@ -33,11 +33,11 @@ dependencies:
m3_lightmeter_iap: m3_lightmeter_iap:
git: git:
url: "https://github.com/vodemn/m3_lightmeter_iap" url: "https://github.com/vodemn/m3_lightmeter_iap"
ref: feature/MLI-48 ref: main
m3_lightmeter_resources: m3_lightmeter_resources:
git: git:
url: "https://github.com/vodemn/m3_lightmeter_resources" url: "https://github.com/vodemn/m3_lightmeter_resources"
ref: feature/MLR-18 ref: v2.5.0
map_launcher: 3.2.0 map_launcher: 3.2.0
material_color_utilities: 0.12.0 material_color_utilities: 0.12.0
package_info_plus: 8.1.3 package_info_plus: 8.1.3