mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-12-24 23:20:41 +00:00
27d56d1061
* setup golden toolkit * implemented `GoldenTestApplicationMock` * added devices with dark theme * implemented MeteringScreen golden test * moved platform channel logic to app mock * implemented SettingsScreen golden test * gitignore golden tests failures * Create dart_test.yaml * adjusted `RulerSlider` ticks height * set master screenshots * run golden tests on ci * fixed `LightSensorService` tests * removed golden workflow call from PR check * Update pr_check.yml
47 lines
1.2 KiB
Dart
47 lines
1.2 KiB
Dart
import 'dart:async';
|
|
import 'package:flutter/foundation.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:golden_toolkit/golden_toolkit.dart';
|
|
|
|
Future<void> testExecutable(FutureOr<void> Function() testMain) async {
|
|
return GoldenToolkit.runWithConfiguration(
|
|
() async {
|
|
await loadAppFonts();
|
|
await testMain();
|
|
},
|
|
config: GoldenToolkitConfiguration(
|
|
defaultDevices: _defaultDevices +
|
|
_defaultDevices
|
|
.map(
|
|
(d) => Device(
|
|
name: '${d.name} (Dark)',
|
|
size: d.size,
|
|
devicePixelRatio: d.devicePixelRatio,
|
|
safeArea: d.safeArea,
|
|
brightness: Brightness.dark,
|
|
),
|
|
)
|
|
.toList(),
|
|
),
|
|
);
|
|
}
|
|
|
|
const _defaultDevices = <Device>[
|
|
Device(
|
|
name: 'iPhone 8',
|
|
size: Size(375, 667),
|
|
devicePixelRatio: 2.0,
|
|
),
|
|
Device(
|
|
name: 'iPhone 13 Pro',
|
|
size: Size(390, 844),
|
|
devicePixelRatio: 3.0,
|
|
safeArea: EdgeInsets.only(top: 44, bottom: 34),
|
|
),
|
|
Device(
|
|
name: 'iPhone 15 Pro Max',
|
|
size: Size(430, 932),
|
|
devicePixelRatio: 3.0,
|
|
safeArea: EdgeInsets.only(top: 44, bottom: 34),
|
|
),
|
|
];
|