m3_lightmeter/test/data/models/camera_features_config_test.dart
Vadim 7c96b5a47d
ML-220 Show focal length when zooming (#233)
* extract focal length from exif

* added focal length section

* wip

* [android] calculate EFL

* split other platform handlers to separate files

* [ios] calculate EFL

* updated translations

* deleted `focalLengthFromTags`

* fixed unit tests

* [ios] link missing files

* updated Pro features screen

* [ios] fixed signing

* fixed screenshot generator

* updated goldens

* [android] updated store screenshots

* wip

* [ios] updated store screenshots

* enable focal length feature by default

* mock camera focal length for integration tests

* cleanup

* added logging to `CameraInfoService`
2025-05-14 10:26:59 +02:00

52 lines
1.1 KiB
Dart

import 'package:lightmeter/data/models/camera_feature.dart';
import 'package:test/test.dart';
void main() {
group(
'fromJson()',
() {
test('All keys', () {
expect(
CameraFeaturesConfigJson.fromJson(
{
'spotMetering': true,
'histogram': true,
'showFocalLength': true,
},
),
{
CameraFeature.spotMetering: true,
CameraFeature.histogram: true,
CameraFeature.showFocalLength: true,
},
);
});
test('Legacy', () {
expect(
CameraFeaturesConfigJson.fromJson({}),
{
CameraFeature.spotMetering: true,
CameraFeature.histogram: false,
CameraFeature.showFocalLength: true,
},
);
});
},
);
test('toJson()', () {
expect(
{
CameraFeature.spotMetering: true,
CameraFeature.histogram: true,
CameraFeature.showFocalLength: true,
}.toJson(),
{
'spotMetering': true,
'histogram': true,
'showFocalLength': true,
},
);
});
}