test(authentication): fix tests
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user