mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-27 09:50:40 +00:00
6566108994
* imlemented `CameraSpotDetector` * separated generic `DialogSwitch` * added `CameraFeature` model * added `CameraFeaturesListTile` to metering section * added features dialog subtitles * added long press to remove metering spot * translations * hide camera features for purchasable status * hide `CameraHistogram` & `CameraSpotDetector` if purchasable * bumped iap version * fixed tests * removed redundant camera state emission * tests * Fixed remote config initalization * updated pro features description
75 lines
1.9 KiB
Dart
75 lines
1.9 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,
|
|
'3': true,
|
|
},
|
|
),
|
|
{
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: true,
|
|
MeteringScreenLayoutFeature.filmPicker: true,
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
|
},
|
|
);
|
|
});
|
|
|
|
test('Legacy (no histogram & equipment profiles)', () {
|
|
expect(
|
|
MeteringScreenLayoutConfigJson.fromJson(
|
|
{
|
|
'0': false,
|
|
'1': false,
|
|
},
|
|
),
|
|
{
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: false,
|
|
MeteringScreenLayoutFeature.filmPicker: false,
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
|
},
|
|
);
|
|
});
|
|
|
|
test('Legacy (no equipment profiles)', () {
|
|
expect(
|
|
MeteringScreenLayoutConfigJson.fromJson(
|
|
{
|
|
'0': false,
|
|
'1': false,
|
|
'2': false,
|
|
},
|
|
),
|
|
{
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: false,
|
|
MeteringScreenLayoutFeature.filmPicker: false,
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
|
},
|
|
);
|
|
});
|
|
},
|
|
);
|
|
|
|
test('toJson()', () {
|
|
expect(
|
|
{
|
|
MeteringScreenLayoutFeature.equipmentProfiles: true,
|
|
MeteringScreenLayoutFeature.extremeExposurePairs: true,
|
|
MeteringScreenLayoutFeature.filmPicker: true,
|
|
}.toJson(),
|
|
{
|
|
'equipmentProfiles': true,
|
|
'extremeExposurePairs': true,
|
|
'filmPicker': true,
|
|
},
|
|
);
|
|
});
|
|
}
|