Skip to content

Commit

Permalink
feat(#119): adiciona GetIt ao teste de recover_account
Browse files Browse the repository at this point in the history
  • Loading branch information
EngDann committed Jan 16, 2025
1 parent 52667d5 commit 7912884
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/ui/recover_account/view/recover_account_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import 'package:aranduapp/ui/shared/request_button.dart';
import 'package:async/async.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:get_it/get_it.dart';
import 'package:mockito/annotations.dart';
import 'package:mockito/mockito.dart';
import 'package:provider/provider.dart';
Expand All @@ -19,7 +20,7 @@ void main() {
late MockRecoverAccountViewModel mockViewModel;
late Command0 mockCommand0;

setUp(() {
setUp(() async {
mockViewModel = MockRecoverAccountViewModel();
mockCommand0 = MockCommand0();

Expand All @@ -28,6 +29,9 @@ void main() {

when(mockViewModel.formKey).thenReturn(GlobalKey<FormState>());
when(mockViewModel.emailController).thenReturn(TextEditingController());

await GetIt.instance.reset();
GetIt.I.registerLazySingleton<RecoverAccountViewModel>(() => mockViewModel);
});

Widget createLoginScreen(MockRecoverAccountViewModel mockViewModel) {
Expand Down

0 comments on commit 7912884

Please sign in to comment.