mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-26 08:00: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
47 lines
984 B
Dart
47 lines
984 B
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,
|
|
},
|
|
),
|
|
{
|
|
CameraFeature.spotMetering: true,
|
|
CameraFeature.histogram: true,
|
|
},
|
|
);
|
|
});
|
|
|
|
test('Legacy (no spotMetering & histogram)', () {
|
|
expect(
|
|
CameraFeaturesConfigJson.fromJson({}),
|
|
{
|
|
CameraFeature.spotMetering: false,
|
|
CameraFeature.histogram: false,
|
|
},
|
|
);
|
|
});
|
|
},
|
|
);
|
|
|
|
test('toJson()', () {
|
|
expect(
|
|
{
|
|
CameraFeature.spotMetering: true,
|
|
CameraFeature.histogram: true,
|
|
}.toJson(),
|
|
{
|
|
'spotMetering': true,
|
|
'histogram': true,
|
|
},
|
|
);
|
|
});
|
|
}
|