mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-08-26 23:16:42 +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() {
|
||||
super.didChangeDependencies();
|
||||
SettingsInteractorProvider.of(context).disableVolumeHandling();
|
||||
IAPProductsProvider.of(context).checkIsPro();
|
||||
IAPProductsProvider.maybeOf(context)?.checkIsPro();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
@ -99,8 +99,23 @@ class _GoldenTestApplicationMockState extends State<GoldenTestApplicationMock> {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MockIapProducts(
|
||||
return IAPProducts(
|
||||
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: MockIAPProviders(
|
||||
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:mocktail/mocktail.dart';
|
||||
|
||||
import '../application_mock.dart';
|
||||
|
||||
class _MockEquipmentProfilesStorageService extends Mock implements IapStorageService {}
|
||||
|
||||
void main() {
|
||||
|
@ -37,7 +35,7 @@ void main() {
|
|||
|
||||
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
||||
await tester.pumpWidget(
|
||||
MockIapProducts(
|
||||
IAPProducts(
|
||||
isPro: isPro,
|
||||
child: EquipmentProfilesProvider(
|
||||
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:mocktail/mocktail.dart';
|
||||
|
||||
import '../application_mock.dart';
|
||||
|
||||
class _MockFilmsStorageService extends Mock implements IapStorageService {}
|
||||
|
||||
void main() {
|
||||
|
@ -34,7 +32,7 @@ void main() {
|
|||
|
||||
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
||||
await tester.pumpWidget(
|
||||
MockIapProducts(
|
||||
IAPProducts(
|
||||
isPro: isPro,
|
||||
child: FilmsProvider(
|
||||
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:mocktail/mocktail.dart';
|
||||
|
||||
import '../application_mock.dart';
|
||||
|
||||
class _MockLogbookPhotosStorageService extends Mock implements IapStorageService {}
|
||||
|
||||
class _MockGeolocationService extends Mock implements GeolocationService {}
|
||||
|
@ -47,7 +45,7 @@ void main() {
|
|||
|
||||
Future<void> pumpTestWidget(WidgetTester tester, bool isPro) async {
|
||||
await tester.pumpWidget(
|
||||
MockIapProducts(
|
||||
IAPProducts(
|
||||
isPro: isPro,
|
||||
child: LogbookPhotosProvider(
|
||||
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 {
|
||||
await tester.pumpWidget(
|
||||
MockIapProducts(
|
||||
IAPProducts(
|
||||
isPro: true,
|
||||
child: EquipmentProfilesProvider(
|
||||
storageService: storageService,
|
||||
|
|
|
@ -27,7 +27,7 @@ void main() {
|
|||
|
||||
Future<void> pumpApplication(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
MockIapProducts(
|
||||
IAPProducts(
|
||||
isPro: true,
|
||||
child: FilmsProvider(
|
||||
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:mocktail/mocktail.dart';
|
||||
|
||||
import '../../../application_mock.dart';
|
||||
import '../../../function_mock.dart';
|
||||
|
||||
class _MockEquipmentProfilesStorageService extends Mock implements IapStorageService {}
|
||||
|
@ -36,7 +35,7 @@ void main() {
|
|||
|
||||
Future<void> pumpTestWidget(WidgetTester tester) async {
|
||||
await tester.pumpWidget(
|
||||
MockIapProducts(
|
||||
IAPProducts(
|
||||
isPro: true,
|
||||
child: EquipmentProfilesProvider(
|
||||
storageService: storageService,
|
||||
|
|
Loading…
Reference in a new issue