m3_lightmeter/test/data/models/metering_screen_layout_config_test.dart
Vadim 886188bb9e
ML-95 Live histogram (#97)
* Added histogram and separated camera view builder

* Added histogram to `MeteringScreenLayoutConfig`

* `ResolutionPreset.medium` -> `ResolutionPreset.low`

* Adjusted histogram paddings
2023-08-06 16:28:20 +02:00

57 lines
1.3 KiB
Dart

import 'package:lightmeter/data/models/metering_screen_layout_config.dart';
import 'package:test/test.dart';
void main() {
group(
'fromJson()',
() {
test('All keys', () {
expect(
MeteringScreenLayoutConfigJson.fromJson(
{
'0': true,
'1': true,
'2': true,
},
),
{
MeteringScreenLayoutFeature.extremeExposurePairs: true,
MeteringScreenLayoutFeature.filmPicker: true,
MeteringScreenLayoutFeature.histogram: true,
},
);
});
test('Legacy (no equipment profiles)', () {
expect(
MeteringScreenLayoutConfigJson.fromJson(
{
'0': true,
'1': true,
},
),
{
MeteringScreenLayoutFeature.extremeExposurePairs: true,
MeteringScreenLayoutFeature.filmPicker: true,
MeteringScreenLayoutFeature.histogram: true,
},
);
});
},
);
test('toJson', () {
expect(
{
MeteringScreenLayoutFeature.extremeExposurePairs: true,
MeteringScreenLayoutFeature.filmPicker: true,
MeteringScreenLayoutFeature.histogram: true,
}.toJson(),
{
'0': true,
'1': true,
'2': true,
},
);
});
}