From 885a724876d8e182c511d72c714071517d8ef15f Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Wed, 29 Aug 2018 16:02:31 +0200 Subject: [PATCH] Make each test independent --- .../auth/containers/SignUpContainer.tsx | 4 +- .../test/__snapshots__/signIn.spec.tsx.snap | 27 +- .../test/__snapshots__/signUp.spec.tsx.snap | 292 +++++++++++++++--- src/core/client/auth/test/signIn.spec.tsx | 70 +++-- src/core/client/auth/test/signUp.spec.tsx | 90 ++++-- 5 files changed, 390 insertions(+), 93 deletions(-) diff --git a/src/core/client/auth/containers/SignUpContainer.tsx b/src/core/client/auth/containers/SignUpContainer.tsx index 8be2d84ed..a4400863f 100644 --- a/src/core/client/auth/containers/SignUpContainer.tsx +++ b/src/core/client/auth/containers/SignUpContainer.tsx @@ -17,8 +17,8 @@ interface SignUpContainerProps { class SignUpContainer extends Component { private onSubmit: SignUpForm["onSubmit"] = async (input, form) => { try { - return await this.props.signUp(input); - form.reset(); + await this.props.signUp(input); + return form.reset(); } catch (error) { return { [FORM_ERROR]: error.message }; } diff --git a/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap b/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap index 33a6f001a..2f6fa4225 100644 --- a/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap +++ b/src/core/client/auth/test/__snapshots__/signIn.spec.tsx.snap @@ -25,14 +25,27 @@ exports[`accepts correct password 1`] = ` Email Address +
+ + + This field is required. + +
+
+ + + This field is required. + +
+
+ + + This field is required. + +
+
+ + + This field is required. + +