diff --git a/apps/frontend/src/app/components/ResetLinkSet.tsx b/apps/frontend/src/app/components/ResetLinkSet.tsx new file mode 100644 index 0000000..fecb44a --- /dev/null +++ b/apps/frontend/src/app/components/ResetLinkSet.tsx @@ -0,0 +1,30 @@ +'use client'; + +import React from 'react'; +import Link from 'next/link'; +import { Button } from '@chakra-ui/react'; + +export default function ResetLinkSet() { + return ( +
+
+

+ Reset Link Sent! +

+
+ We sent a reset link to name@gmail.com with a link to reset your password. +
+
+
+ {/* TODO: connect up to backend */} + + {/* TODO: Update href when login page route is finalized */} + + Back to login + +
+
+ ); +} diff --git a/apps/frontend/src/app/components/ResetPasswordForm.tsx b/apps/frontend/src/app/components/ResetPasswordForm.tsx new file mode 100644 index 0000000..10b73f6 --- /dev/null +++ b/apps/frontend/src/app/components/ResetPasswordForm.tsx @@ -0,0 +1,32 @@ +'use client'; + +import React from 'react'; +import TextInputField from './TextInputField'; +import Link from 'next/link'; +import { Button } from '@chakra-ui/react'; + +export default function ResetPasswordForm() { + return ( +
+
+

+ Forgot your Password? +

+
+ Please enter the email address you'd like your password reset information sent to +
+
+
+ + {/* TODO: connect up to backend */} + + {/* TODO: Update href when login page route is finalized */} + + Back to login + +
+
+ ); +} diff --git a/apps/frontend/src/app/globals.css b/apps/frontend/src/app/globals.css index 35f7f0e..3487c60 100644 --- a/apps/frontend/src/app/globals.css +++ b/apps/frontend/src/app/globals.css @@ -1,4 +1,4 @@ -@import url('https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&family=Roboto+Slab:wght@400;600&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&family=Roboto+Slab:wght@400;600;700&display=swap'); @import "tailwindcss"; @theme { diff --git a/apps/frontend/test/components/ResetLinkSet.test.tsx b/apps/frontend/test/components/ResetLinkSet.test.tsx new file mode 100644 index 0000000..1781083 --- /dev/null +++ b/apps/frontend/test/components/ResetLinkSet.test.tsx @@ -0,0 +1,26 @@ +import { render, screen } from '../utils'; +import ResetLinkSet from '@/app/components/ResetLinkSet'; + +describe('ResetLinkSet Component', () => { + it('renders the heading', () => { + render(); + expect(screen.getByText('Reset Link Sent!', { selector: 'h1' })).toBeInTheDocument(); + }); + + it('renders the subheading', () => { + render(); + expect(screen.getByText(/we sent a reset link/i, { selector: 'h5' })).toBeInTheDocument(); + }); + + it('renders the request reset link again button', () => { + render(); + expect(screen.getByRole('button', { name: 'Request reset link again' })).toBeInTheDocument(); + }); + + it('renders the back to login link', () => { + render(); + const link = screen.getByRole('link', { name: 'Back to login' }); + expect(link).toBeInTheDocument(); + expect(link).toHaveAttribute('href', '#'); + }); +}); diff --git a/apps/frontend/test/components/ResetPasswordForm.test.tsx b/apps/frontend/test/components/ResetPasswordForm.test.tsx new file mode 100644 index 0000000..a5b98f9 --- /dev/null +++ b/apps/frontend/test/components/ResetPasswordForm.test.tsx @@ -0,0 +1,31 @@ +import { render, screen } from '../utils'; +import ResetPasswordForm from '@/app/components/ResetPasswordForm'; + +describe('ResetPasswordForm Component', () => { + it('renders the heading', () => { + render(); + expect(screen.getByText('Forgot your Password?', { selector: 'h1' })).toBeInTheDocument(); + }); + + it('renders the subheading', () => { + render(); + expect(screen.getByText(/please enter the email address/i, { selector: 'h5' })).toBeInTheDocument(); + }); + + it('renders the email input field', () => { + render(); + expect(screen.getByPlaceholderText('Placeholder')).toBeInTheDocument(); + }); + + it('renders the request reset link button', () => { + render(); + expect(screen.getByRole('button', { name: 'Request reset link' })).toBeInTheDocument(); + }); + + it('renders the back to login link', () => { + render(); + const link = screen.getByRole('link', { name: 'Back to login' }); + expect(link).toBeInTheDocument(); + expect(link).toHaveAttribute('href', '#'); + }); +});