Skip to content

Commit

Permalink
fix(tests): fix the home page test
Browse files Browse the repository at this point in the history
  • Loading branch information
jerensl committed Sep 9, 2023
1 parent feb4d23 commit 7b8c5fb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions __tests__/pages/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ useRouter.mockImplementation(() => ({
jest.mock(
'next/image',
() =>
(function Image({ src, alt }: any) {
function Image({ src, alt }: any) {
// eslint-disable-next-line @next/next/no-img-element
return <img src={src} alt={alt} />
})
}
)

jest.mock('remark-math', () => jest.fn())
Expand Down Expand Up @@ -64,9 +64,11 @@ describe('Home', () => {
render(<Home />)

const heading = screen.getByRole('heading', {
name: /Jerens Lensun/i,
name: /Hi I'm Jerens/i,
})
const subHeading = screen.getByText('Software Engineer')
const subHeading = screen.getByText(
'I work with React & Golang Ecosystem, and write about software development.'
)

expect(heading).toBeInTheDocument()
expect(subHeading).toBeInTheDocument()
Expand Down

0 comments on commit 7b8c5fb

Please sign in to comment.