Skip to content

Commit

Permalink
Merge pull request #2701 from TalaoDAO/october
Browse files Browse the repository at this point in the history
October
  • Loading branch information
bibash28 authored May 31, 2024
2 parents a89d278 + 60f5ba0 commit 6e0043a
Show file tree
Hide file tree
Showing 4 changed files with 143 additions and 9 deletions.
8 changes: 6 additions & 2 deletions lib/onboarding/tos/view/onboarding_tos_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ class OnBoardingTosPage extends StatelessWidget {
Widget build(BuildContext context) {
return BlocProvider<OnBoardingTosCubit>(
create: (_) => OnBoardingTosCubit(),
child: OnBoardingTosView(
onBoardingTosCubit: context.read<OnBoardingTosCubit>(),
child: Builder(
builder: (context) {
return OnBoardingTosView(
onBoardingTosCubit: context.read<OnBoardingTosCubit>(),
);
},
),
);
}
Expand Down
16 changes: 10 additions & 6 deletions lib/onboarding/verify_phrase/view/onboarding_verify_phrase.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,16 @@ class OnBoardingVerifyPhrasePage extends StatelessWidget {
altmeChatSupportCubit: context.read<AltmeChatSupportCubit>(),
profileCubit: context.read<ProfileCubit>(),
),
child: OnBoardingVerifyPhraseView(
mnemonic: mnemonic,
isFromOnboarding: isFromOnboarding,
onBoardingVerifyPhraseCubit:
context.read<OnBoardingVerifyPhraseCubit>(),
onboardingCubit: context.read<OnboardingCubit>(),
child: Builder(
builder: (context) {
return OnBoardingVerifyPhraseView(
mnemonic: mnemonic,
isFromOnboarding: isFromOnboarding,
onBoardingVerifyPhraseCubit:
context.read<OnBoardingVerifyPhraseCubit>(),
onboardingCubit: context.read<OnboardingCubit>(),
);
},
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: altme
description: AltMe Flutter App
version: 2.5.9+459
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment:
sdk: ">=3.1.0 <4.0.0"

Expand Down
126 changes: 126 additions & 0 deletions test/pin_code/view/pin_code_page_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// import 'package:altme/app/app.dart';
// import 'package:altme/dashboard/dashboard.dart';
// import 'package:altme/flavor/flavor.dart';
// import 'package:altme/pin_code/pin_code.dart';
// import 'package:bloc_test/bloc_test.dart';
// import 'package:flutter/material.dart';
// import 'package:flutter_bloc/flutter_bloc.dart';
// import 'package:flutter_test/flutter_test.dart';
// import 'package:mockingjay/mockingjay.dart';
// import 'package:secure_storage/secure_storage.dart';

// import '../../helpers/helpers.dart';

// class MockProfleCubit extends MockCubit<ProfileState> implements ProfileCubit {
// @override
// final state = ProfileState(model: ProfileModel.empty());
// }

// class MockSecureStorageProvider extends Mock implements SecureStorageProvider {}

// class MockLocalAuthApi extends Mock implements LocalAuthApi {}

// class MockFlavorCubit extends MockCubit<FlavorMode> implements FlavorCubit {
// @override
// final state = FlavorMode.development;
// }

// void main() {
// group('Pincode Page', () {
// final PinCodeViewCubit pinCodeViewCubit = PinCodeViewCubit();
// final MockNavigator navigator = MockNavigator();
// final MockSecureStorageProvider secureStorageProvider =
// MockSecureStorageProvider();
// final MockProfleCubit profleCubit = MockProfleCubit();
// final MockLocalAuthApi localAuthApi = MockLocalAuthApi();
// final MockFlavorCubit flavorCubit = MockFlavorCubit();

// setUpAll(() {
// when(() => secureStorageProvider.get(any())).thenAnswer((_) async => '');

// when(() => secureStorageProvider.set(any(), any()))
// .thenAnswer((_) async => Future<void>.value());

// when(navigator.canPop).thenReturn(true);
// when(() => navigator.push<void>(any())).thenAnswer((_) async {});
// when(() => navigator.pushAndRemoveUntil<void>(any(), any()))
// .thenAnswer((_) async {});
// when(() => navigator.pushReplacement<void, void>(any()))
// .thenAnswer((_) async {});
// });

// testWidgets('is routable', (tester) async {
// await tester.pumpApp(
// MockNavigatorProvider(
// navigator: navigator,
// child: Builder(
// builder: (context) => Scaffold(
// floatingActionButton: FloatingActionButton(
// onPressed: () {
// Navigator.of(context).push<void>(
// PinCodePage.route(
// isValidCallback: () {},
// walletProtectionType: WalletProtectionType.FA2,
// ),
// );
// },
// ),
// ),
// ),
// ),
// );
// await tester.tap(find.byType(FloatingActionButton));
// await tester.pumpAndSettle();

// verify(
// () => navigator.push<void>(
// any(
// that: isRoute<void>(
// whereName: equals('/pinCodePage'),
// ),
// ),
// ),
// ).called(1);
// });

// testWidgets('renders PinCodePage', (tester) async {
// await tester.pumpApp(
// MultiBlocProvider(
// providers: [
// BlocProvider<ProfileCubit>.value(value: profleCubit),
// BlocProvider<PinCodeViewCubit>.value(value: pinCodeViewCubit),
// BlocProvider<FlavorCubit>.value(value: flavorCubit),
// ],
// child: PinCodePage(
// isValidCallback: () {},
// walletProtectionType: WalletProtectionType.FA2,
// secureStorageProvider: secureStorageProvider,
// localAuthApi: localAuthApi,
// ),
// ),
// );
// expect(find.byType(PinCodeView), findsOneWidget);
// });

// testWidgets('renders UI correctly', (tester) async {
// await tester.pumpApp(
// MultiBlocProvider(
// providers: [
// BlocProvider<ProfileCubit>.value(value: profleCubit),
// BlocProvider<PinCodeViewCubit>.value(value: pinCodeViewCubit),
// BlocProvider<FlavorCubit>.value(value: flavorCubit),
// ],
// child: PinCodeView(
// isValidCallback: () {},
// walletProtectionType: WalletProtectionType.FA2,
// secureStorageProvider: secureStorageProvider,
// localAuthApi: localAuthApi,
// profileCubit: profleCubit,
// ),
// ),
// );
// expect(find.byType(BasePage), findsOneWidget);
// expect(find.byType(PinCodeWidget), findsOneWidget);
// });
// });
// }

0 comments on commit 6e0043a

Please sign in to comment.