Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use screen instead of destructing render #21

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions app/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,25 @@
// SPDX-License-Identifier: MIT
//

import React from 'react'
import { render } from '@testing-library/react'
import { render, screen } from '@testing-library/react'
import '@testing-library/jest-dom'
import Home from './page'

describe('Home Component', () => {
it('renders the Stanford Biodesign Digital Health Next.js Template heading', () => {
const { getByText } = render(<Home />)
render(<Home />)

const headingElement = getByText(
const headingElement = screen.getByText(
/Welcome to the Stanford Biodesign Digital Health Next.js Template/i,
)

expect(headingElement).toBeInTheDocument()
})

it('renders the Stanford Biodesign Logo', () => {
const { getByAltText } = render(<Home />)
render(<Home />)

const imageElement = getByAltText(
const imageElement = screen.getByAltText(
'Stanford Biodesign Logo',
) as HTMLImageElement

Expand Down
Loading