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(
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',
);
@ -204,7 +204,7 @@ void testLogbookEquipmentProfileChanges(String description) {
_expectPickerListTileValue(
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',
);

View file

@ -59,7 +59,7 @@ void testToggleLayoutFeatures(String description) {
);
expectExtremeExposurePairs(
'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',
);
expectExposurePairsListItem(
@ -73,7 +73,7 @@ void testToggleLayoutFeatures(String description) {
expectExposurePairsListItem(
tester,
'f/45',
'6"',
'6s',
reason:
'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 {
await tester.pumpApplication();
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');
await tester.scrollToTheLastExposurePair();
expectExposurePairsListItem(tester, 'f/45', '6"');
expectExposurePairsListItem(tester, 'f/45', '6s');
// Disable layout feature
await tester.toggleLayoutFeature(S.current.meteringScreenFeatureExtremeExposurePairs);
@ -116,7 +116,7 @@ void testToggleLayoutFeatures(String description) {
expectExposurePairsListItem(
tester,
'f/45',
'6"',
'6s',
reason:
'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);
expectExtremeExposurePairs(
'f/1.0 - 1/320',
'f/45 - 6"',
'f/45 - 6s',
reason:
'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.takePhoto();
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');
await tester.scrollToTheLastExposurePair();
expectExposurePairsListItem(tester, 'f/45', '12"');
expectExposurePairsListItem(tester, 'f/45', '12s');
// Disable layout feature
await tester.toggleLayoutFeature(S.current.meteringScreenFeatureFilmPicker);
@ -153,7 +153,7 @@ void testToggleLayoutFeatures(String description) {
);
expectExtremeExposurePairs(
'f/1.0 - 1/320',
'f/45 - 6"',
'f/45 - 6s',
reason: 'Shutter speed must not be affected by reciprocity when film is discarded.',
);
expectExposurePairsListItem(
@ -166,7 +166,7 @@ void testToggleLayoutFeatures(String description) {
expectExposurePairsListItem(
tester,
'f/45',
'6"',
'6s',
reason: 'Shutter speed must not be affected by reciprocity when film is discarded.',
);

View file

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

View file

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

View file

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