diff --git a/.idea/hackstreetboys.iml b/.idea/hackstreetboys.iml index 9c3c81d7..a80cc75f 100644 --- a/.idea/hackstreetboys.iml +++ b/.idea/hackstreetboys.iml @@ -8,5 +8,6 @@ + \ No newline at end of file diff --git a/frontend/src/assets/minus.png b/frontend/src/assets/minus.png index 38b7deec..928b2cd7 100644 Binary files a/frontend/src/assets/minus.png and b/frontend/src/assets/minus.png differ diff --git a/frontend/src/components/LoginForm.tsx b/frontend/src/components/LoginForm.tsx index 6f46b72c..d017ed2c 100644 --- a/frontend/src/components/LoginForm.tsx +++ b/frontend/src/components/LoginForm.tsx @@ -90,11 +90,11 @@ export const LoginForm: React.FC = () => { type="password" /> - + Log In Forgot Password? - {error === true && Username or Password Incorrect. Has the email been verified?} + {error === true && Username or Password Incorrect. Has the email been verified?} ); } diff --git a/frontend/src/pages/Home.tsx b/frontend/src/pages/Home.tsx index 547d7484..9eea7d3f 100644 --- a/frontend/src/pages/Home.tsx +++ b/frontend/src/pages/Home.tsx @@ -230,7 +230,7 @@ function Home() { // If user context does not exist -- display login or add some (context.currentUser !== undefined) ?

You don't have any favorites yet! See our recipes and go add some!

- :

Login to see your favorites!

} + :

Login to see your favorites!

} diff --git a/frontend/src/tests/Goal.test.tsx b/frontend/src/tests/Goal.test.tsx index 2a872b8c..bbfa1c96 100644 --- a/frontend/src/tests/Goal.test.tsx +++ b/frontend/src/tests/Goal.test.tsx @@ -19,19 +19,43 @@ import { BASE_URL, fetchUsers } from "./utils"; jest.mock("axios"); // app.test.js -test('goal app rendering/navigating', () => { +test('link goals login redirect', () => { render() //expect(screen.getByText(/You are on the home page/i)).toBeInTheDocument() - const goalshome = {button: 0} - userEvent.click(screen.getByTestId('loginGoals'), goalshome) - - expect(screen.getByText(/LOGIN/i)).toBeInTheDocument() + // const goalshome = {button: 0} + // userEvent.click(screen.getByTestId('loginGoals'), goalshome) + // + // expect(screen.getByText(/LOGIN/i)).toBeInTheDocument() + // + // const goalsmenu = {button: 0} + // userEvent.click(screen.getByTestId('menuGoals'), goalsmenu) + // + // expect(screen.getByText(/LOGIN/i)).toBeInTheDocument() + + userEvent.click(screen.getByTestId('loginGoals')) + + expect(screen.getByTestId("login-button")).toBeInTheDocument() +}) - const goalsmenu = {button: 0} - userEvent.click(screen.getByTestId('menuGoals'), goalsmenu) - - expect(screen.getByText(/LOGIN/i)).toBeInTheDocument() +test('menu goals login redirect', () => { + render() + //expect(screen.getByText(/You are on the home page/i)).toBeInTheDocument() + + // const goalshome = {button: 0} + // userEvent.click(screen.getByTestId('loginGoals'), goalshome) + // + // expect(screen.getByText(/LOGIN/i)).toBeInTheDocument() + // + // const goalsmenu = {button: 0} + // userEvent.click(screen.getByTestId('menuGoals'), goalsmenu) + // + // expect(screen.getByText(/LOGIN/i)).toBeInTheDocument() + + + userEvent.click(screen.getByTestId('menuGoals')) + + expect(screen.getByTestId("login-button")).toBeInTheDocument() }) diff --git a/frontend/src/tests/Login.test.tsx b/frontend/src/tests/Login.test.tsx index 99db8a53..04bc9425 100644 --- a/frontend/src/tests/Login.test.tsx +++ b/frontend/src/tests/Login.test.tsx @@ -15,18 +15,14 @@ test('wrong login', () => { render(); // Clicks through to registration - userEvent.click(screen.getByText("Register/Log In")); + userEvent.click(screen.getByTestId("favorite-login")); // Clicks through to login - userEvent.click(screen.getByText("Log in")); - - // Clicks through to login with unsatisfactory credentials - userEvent.click(screen.getByText("Log In")); - - // console.log(screen.getAllByText(/log in/i)) + userEvent.click(screen.getByTestId("login-button")); + userEvent.click(screen.getByTestId("login-button")); // Checks for the login label at the top of the expected screen - expect(screen.getByText("Login")).toBeInTheDocument() + expect(screen.getByTestId("login-button")).toBeInTheDocument() }); @@ -36,13 +32,13 @@ test('password reset', () => { render(); // Clicks through to login - userEvent.click(screen.getByText('Log In')); + userEvent.click(screen.getByTestId("favorite-login")); // Indicates that user wants to reset password - userEvent.click(screen.getByText('Forgot Password?')); + userEvent.click(screen.getByText(/forgot/i)); // console.log(screen.getAllByText(/password reset/i)) // Checks for the Password Reset label at the top of the expected screen - expect(screen.getByText("Password Reset")).toBeInTheDocument(); + expect(screen.getByText(/request password reset/i)).toBeInTheDocument(); });