Skip to content

Commit

Permalink
include test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jarrodlilkendey committed May 28, 2024
1 parent dac0cba commit 84bbcbf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
14 changes: 14 additions & 0 deletions __tests__/ui/tests/habits.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { render, screen } from '@testing-library/react'
// import { mockTools } from '@/__mocks__/mockData'

import HabitsPage from '@/pages/habits'

describe('Time Tracker Page tests', () => {
test('renders a heading', async () => {
render(<HabitsPage />)

expect(
screen.getByRole('heading', { name: 'Habit Tracker' })
).toBeInTheDocument()
})
})
2 changes: 1 addition & 1 deletion pages/login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import SignInForm from '@/components/auth/SignInForm'
import SignUpForm from '@/components/auth/SignUpForm'

export default function LoginSignUp() {
export default function LoginSignUpPage() {
return (
<div className='grid grid-cols-2 gap-4'>
<SignInForm />
Expand Down
10 changes: 2 additions & 8 deletions pages/user/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { useSession } from 'next-auth/react'

// data strategy: Client-Side Rendering with SWR (within UserReservations component)
// (static pages or ISR doesn't make sense; only one user is using this page!
// no advantage to caching.)
// Why not SSR? no need for SEO either, esp since it's behind auth barrier!
// plus SSR is slow

export default function UserProfile() {
export default function UserPage() {
const { data: session } = useSession()

const userId = session?.user?.user?.id
Expand All @@ -20,4 +14,4 @@ export default function UserProfile() {
)
}

UserProfile.auth = true
UserPage.auth = true

0 comments on commit 84bbcbf

Please sign in to comment.