Fix sign up form bug
This commit is contained in:
@@ -19,7 +19,7 @@ describe("UseContext", () => {
|
||||
<button data-testid="signUpNoEmail" onClick={() => signUp("")}/>
|
||||
<button data-testid="signUpNoPassword" onClick={() => signUp("test@test.com", "")}/>
|
||||
<button data-testid="signUpBadConfirm" onClick={() => signUp("test@test.com", "password", "")}/>
|
||||
<button data-testid="signUp" onClick={() => signUp("test@test.com", "password", "password")}/>
|
||||
<button data-testid="signUp" onClick={() => signUp("test@test.com", "password", "password")}/>
|
||||
</>
|
||||
);
|
||||
};
|
||||
@@ -60,10 +60,11 @@ describe("UseContext", () => {
|
||||
});
|
||||
|
||||
it("Handle server error", async () => {
|
||||
auth.setSignUpResponse({ message: "SERVER-ERROR", error: "ERR" });
|
||||
auth.setSignInResponse({ message: "SIGN-IN-ERROR" })
|
||||
auth.setSignUpResponse({ message: "SIGN-UP-ERROR", error: "ERR" });
|
||||
fireEvent.click(screen.getByTestId("signUp"));
|
||||
await waitFor(() => expect(screen.getByTestId("fetching").innerHTML).toEqual("false"));
|
||||
expect(screen.getByTestId("error").innerHTML).toEqual("SERVER-ERROR");
|
||||
expect(screen.getByTestId("error").innerHTML).toEqual("SIGN-UP-ERROR");
|
||||
auth.setSignUpResponse({});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user