test(authentication): fix tests

This commit is contained in:
2023-04-13 23:21:38 +02:00
parent 9ff7b73aeb
commit 1451240f1a
3 changed files with 27 additions and 23 deletions
@@ -65,6 +65,13 @@ void main() {
),
).thenAnswer((_) async => Ok(account));
when(
() => authenticationRepository.signInWithEmailAndPassword(
email: any(named: 'email'),
password: any(named: 'password'),
),
).thenAnswer((_) async => Ok(account));
when(
() => authenticationRepository.formRepository,
).thenAnswer((_) => formRepository);
@@ -258,13 +265,13 @@ void main() {
);
});
group('submit', () {
group('signUpWithEmailPassword', () {
blocTest<SignUpCubit<int>, SignUpState>(
'does nothing when status is not validated',
build: () => SignUpCubit(
authenticationRepository: authenticationRepository,
),
act: (cubit) => cubit.submit(),
act: (cubit) => cubit.signUpWithEmailPassword(),
expect: () => const <SignUpState>[],
);
@@ -308,7 +315,7 @@ void main() {
),
status: FormStatus.valid,
),
act: (cubit) => cubit.submit(),
act: (cubit) => cubit.signUpWithEmailPassword(),
verify: (_) {
verify(
() => authenticationRepository.signUp(
@@ -360,7 +367,7 @@ void main() {
),
status: FormStatus.valid,
),
act: (cubit) => cubit.submit(),
act: (cubit) => cubit.signUpWithEmailPassword(),
expect: () => <SignUpState>[
SignUpState(
form: WyattFormImpl(
@@ -444,7 +451,7 @@ void main() {
),
status: FormStatus.valid,
),
act: (cubit) => cubit.submit(),
act: (cubit) => cubit.signUpWithEmailPassword(),
expect: () => <SignUpState>[
SignUpState(
form: WyattFormImpl(