fix(auth): update form plugin and fix auth
This commit is contained in:
@@ -68,9 +68,9 @@ void main() {
|
||||
SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
).state,
|
||||
SignUpState(data: FormData.empty()),
|
||||
const SignUpState(data: FormData.empty()),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -80,11 +80,11 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
act: (SignUpCubit cubit) => cubit.emailChanged(invalidEmailString),
|
||||
expect: () => <SignUpState>[
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
email: invalidEmail,
|
||||
status: FormStatus.invalid,
|
||||
data: FormData.empty(),
|
||||
@@ -97,15 +97,15 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
seed: () => SignUpState(
|
||||
seed: () => const SignUpState(
|
||||
password: validPassword,
|
||||
data: FormData.empty(),
|
||||
),
|
||||
act: (SignUpCubit cubit) => cubit.emailChanged(validEmailString),
|
||||
expect: () => <SignUpState>[
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
status: FormStatus.valid,
|
||||
@@ -121,12 +121,12 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
act: (SignUpCubit cubit) =>
|
||||
cubit.passwordChanged(invalidPasswordString),
|
||||
expect: () => <SignUpState>[
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
password: invalidPassword,
|
||||
status: FormStatus.invalid,
|
||||
data: FormData.empty(),
|
||||
@@ -139,15 +139,15 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
seed: () => SignUpState(
|
||||
seed: () => const SignUpState(
|
||||
email: validEmail,
|
||||
data: FormData.empty(),
|
||||
),
|
||||
act: (SignUpCubit cubit) => cubit.passwordChanged(validPasswordString),
|
||||
expect: () => <SignUpState>[
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
status: FormStatus.valid,
|
||||
@@ -163,7 +163,7 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
act: (SignUpCubit cubit) => cubit.signUpFormSubmitted(),
|
||||
expect: () => const <SignUpState>[],
|
||||
@@ -174,9 +174,9 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
seed: () => SignUpState(
|
||||
seed: () => const SignUpState(
|
||||
status: FormStatus.valid,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
@@ -199,9 +199,9 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
seed: () => SignUpState(
|
||||
seed: () => const SignUpState(
|
||||
status: FormStatus.valid,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
@@ -209,13 +209,13 @@ void main() {
|
||||
),
|
||||
act: (SignUpCubit cubit) => cubit.signUpFormSubmitted(),
|
||||
expect: () => <SignUpState>[
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
status: FormStatus.submissionInProgress,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
data: FormData.empty(),
|
||||
),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
status: FormStatus.submissionSuccess,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
@@ -238,9 +238,9 @@ void main() {
|
||||
build: () => SignUpCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
authenticationCubit: authenticationCubit,
|
||||
entries: FormData.empty(),
|
||||
entries: const FormData.empty(),
|
||||
),
|
||||
seed: () => SignUpState(
|
||||
seed: () => const SignUpState(
|
||||
status: FormStatus.valid,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
@@ -248,13 +248,13 @@ void main() {
|
||||
),
|
||||
act: (SignUpCubit cubit) => cubit.signUpFormSubmitted(),
|
||||
expect: () => <SignUpState>[
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
status: FormStatus.submissionInProgress,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
data: FormData.empty(),
|
||||
),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
status: FormStatus.submissionFailure,
|
||||
email: validEmail,
|
||||
password: validPassword,
|
||||
|
||||
@@ -26,10 +26,10 @@ void main() {
|
||||
group('SignUpState', () {
|
||||
test('supports value comparisons', () {
|
||||
expect(
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
),
|
||||
);
|
||||
@@ -37,10 +37,10 @@ void main() {
|
||||
|
||||
test('returns same object when no properties are passed', () {
|
||||
expect(
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
).copyWith(),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
),
|
||||
);
|
||||
@@ -48,10 +48,10 @@ void main() {
|
||||
|
||||
test('returns object with updated status when status is passed', () {
|
||||
expect(
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
).copyWith(status: FormStatus.pure),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
),
|
||||
);
|
||||
@@ -59,10 +59,10 @@ void main() {
|
||||
|
||||
test('returns object with updated email when email is passed', () {
|
||||
expect(
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
).copyWith(email: email),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
email: email,
|
||||
data: FormData.empty(),
|
||||
),
|
||||
@@ -71,10 +71,10 @@ void main() {
|
||||
|
||||
test('returns object with updated password when password is passed', () {
|
||||
expect(
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
).copyWith(password: password),
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
password: password,
|
||||
data: FormData.empty(),
|
||||
),
|
||||
@@ -85,12 +85,12 @@ void main() {
|
||||
'returns object with updated data'
|
||||
' when data is passed', () {
|
||||
expect(
|
||||
SignUpState(
|
||||
const SignUpState(
|
||||
data: FormData.empty(),
|
||||
).copyWith(
|
||||
data: const FormData(
|
||||
[
|
||||
FormEntry(
|
||||
FormInput(
|
||||
'field',
|
||||
Name.pure(),
|
||||
),
|
||||
@@ -100,7 +100,7 @@ void main() {
|
||||
const SignUpState(
|
||||
data: FormData(
|
||||
[
|
||||
FormEntry(
|
||||
FormInput(
|
||||
'field',
|
||||
Name.pure(),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user