mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-08-26 15:06:43 +00:00
fixed golden tests
This commit is contained in:
parent
fa437a4240
commit
9c9f6def33
9 changed files with 23 additions and 38 deletions
|
@ -23,7 +23,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
SettingsInteractorProvider.of(context).disableVolumeHandling();
|
SettingsInteractorProvider.of(context).disableVolumeHandling();
|
||||||
IAPProductsProvider.of(context).checkIsPro();
|
IAPProductsProvider.maybeOf(context)?.checkIsPro();
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -99,8 +99,23 @@ class _GoldenTestApplicationMockState extends State<GoldenTestApplicationMock> {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MockIapProducts(
|
return IAPProducts(
|
||||||
isPro: widget.isPro,
|
isPro: widget.isPro,
|
||||||
|
lifetime: const IAPProduct(
|
||||||
|
storeId: '',
|
||||||
|
type: PurchaseType.lifetime,
|
||||||
|
price: '0.0\$',
|
||||||
|
),
|
||||||
|
yearly: const IAPProduct(
|
||||||
|
storeId: '',
|
||||||
|
type: PurchaseType.yearly,
|
||||||
|
price: '0.0\$',
|
||||||
|
),
|
||||||
|
monthly: const IAPProduct(
|
||||||
|
storeId: '',
|
||||||
|
type: PurchaseType.monthly,
|
||||||
|
price: '0.0\$',
|
||||||
|
),
|
||||||
child: _MockApplicationWrapper(
|
child: _MockApplicationWrapper(
|
||||||
child: MockIAPProviders(
|
child: MockIAPProviders(
|
||||||
selectedEquipmentProfileId: mockEquipmentProfiles.first.id,
|
selectedEquipmentProfileId: mockEquipmentProfiles.first.id,
|
||||||
|
@ -169,26 +184,3 @@ class _MockApplicationWrapper extends StatelessWidget {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class MockIapProducts extends IAPProducts {
|
|
||||||
MockIapProducts({
|
|
||||||
required super.isPro,
|
|
||||||
required super.child,
|
|
||||||
}) : super(
|
|
||||||
lifetime: IAPProduct(
|
|
||||||
storeId: '',
|
|
||||||
type: PurchaseType.lifetime,
|
|
||||||
price: '0.0\$',
|
|
||||||
),
|
|
||||||
yearly: IAPProduct(
|
|
||||||
storeId: '',
|
|
||||||
type: PurchaseType.yearly,
|
|
||||||
price: '0.0\$',
|
|
||||||
),
|
|
||||||
monthly: IAPProduct(
|
|
||||||
storeId: '',
|
|
||||||
type: PurchaseType.monthly,
|
|
||||||
price: '0.0\$',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:mocktail/mocktail.dart';
|
import 'package:mocktail/mocktail.dart';
|
||||||
|
|
||||||
import '../application_mock.dart';
|
|
||||||
|
|
||||||
class _MockEquipmentProfilesStorageService extends Mock implements IapStorageService {}
|
class _MockEquipmentProfilesStorageService extends Mock implements IapStorageService {}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -37,7 +35,7 @@ void main() {
|
||||||
|
|
||||||
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MockIapProducts(
|
IAPProducts(
|
||||||
isPro: isPro,
|
isPro: isPro,
|
||||||
child: EquipmentProfilesProvider(
|
child: EquipmentProfilesProvider(
|
||||||
storageService: storageService,
|
storageService: storageService,
|
||||||
|
|
|
@ -5,8 +5,6 @@ import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:mocktail/mocktail.dart';
|
import 'package:mocktail/mocktail.dart';
|
||||||
|
|
||||||
import '../application_mock.dart';
|
|
||||||
|
|
||||||
class _MockFilmsStorageService extends Mock implements IapStorageService {}
|
class _MockFilmsStorageService extends Mock implements IapStorageService {}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -34,7 +32,7 @@ void main() {
|
||||||
|
|
||||||
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MockIapProducts(
|
IAPProducts(
|
||||||
isPro: isPro,
|
isPro: isPro,
|
||||||
child: FilmsProvider(
|
child: FilmsProvider(
|
||||||
storageService: storageService,
|
storageService: storageService,
|
||||||
|
|
|
@ -6,8 +6,6 @@ import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:mocktail/mocktail.dart';
|
import 'package:mocktail/mocktail.dart';
|
||||||
|
|
||||||
import '../application_mock.dart';
|
|
||||||
|
|
||||||
class _MockLogbookPhotosStorageService extends Mock implements IapStorageService {}
|
class _MockLogbookPhotosStorageService extends Mock implements IapStorageService {}
|
||||||
|
|
||||||
class _MockGeolocationService extends Mock implements GeolocationService {}
|
class _MockGeolocationService extends Mock implements GeolocationService {}
|
||||||
|
@ -47,7 +45,7 @@ void main() {
|
||||||
|
|
||||||
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MockIapProducts(
|
IAPProducts(
|
||||||
isPro: isPro,
|
isPro: isPro,
|
||||||
child: LogbookPhotosProvider(
|
child: LogbookPhotosProvider(
|
||||||
storageService: storageService,
|
storageService: storageService,
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 316 KiB After Width: | Height: | Size: 298 KiB |
|
@ -25,7 +25,7 @@ void main() {
|
||||||
|
|
||||||
Future<void> pumpApplication(WidgetTester tester) async {
|
Future<void> pumpApplication(WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MockIapProducts(
|
IAPProducts(
|
||||||
isPro: true,
|
isPro: true,
|
||||||
child: EquipmentProfilesProvider(
|
child: EquipmentProfilesProvider(
|
||||||
storageService: storageService,
|
storageService: storageService,
|
||||||
|
|
|
@ -27,7 +27,7 @@ void main() {
|
||||||
|
|
||||||
Future<void> pumpApplication(WidgetTester tester) async {
|
Future<void> pumpApplication(WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MockIapProducts(
|
IAPProducts(
|
||||||
isPro: true,
|
isPro: true,
|
||||||
child: FilmsProvider(
|
child: FilmsProvider(
|
||||||
storageService: mockFilmsStorageService,
|
storageService: mockFilmsStorageService,
|
||||||
|
|
|
@ -6,7 +6,6 @@ import 'package:m3_lightmeter_iap/m3_lightmeter_iap.dart';
|
||||||
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
import 'package:m3_lightmeter_resources/m3_lightmeter_resources.dart';
|
||||||
import 'package:mocktail/mocktail.dart';
|
import 'package:mocktail/mocktail.dart';
|
||||||
|
|
||||||
import '../../../application_mock.dart';
|
|
||||||
import '../../../function_mock.dart';
|
import '../../../function_mock.dart';
|
||||||
|
|
||||||
class _MockEquipmentProfilesStorageService extends Mock implements IapStorageService {}
|
class _MockEquipmentProfilesStorageService extends Mock implements IapStorageService {}
|
||||||
|
@ -36,7 +35,7 @@ void main() {
|
||||||
|
|
||||||
Future<void> pumpTestWidget(WidgetTester tester) async {
|
Future<void> pumpTestWidget(WidgetTester tester) async {
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
MockIapProducts(
|
IAPProducts(
|
||||||
isPro: true,
|
isPro: true,
|
||||||
child: EquipmentProfilesProvider(
|
child: EquipmentProfilesProvider(
|
||||||
storageService: storageService,
|
storageService: storageService,
|
||||||
|
|
Loading…
Reference in a new issue