Skip to content

Commit

Permalink
address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
alexvuong committed May 15, 2023
1 parent b18c75c commit 2f69f6a
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,15 @@ describe('Document', () => {
// by default, React Testing Library append the test component into a body tag, since our component is a full DOM
// there will be two body tags in the DOM, we only want to check the second one
const bodyTag = document.querySelectorAll('body')[1]
// it looks like it returns two html collection, the first one is the React Testing library, the second one is our component we are testing
const htmlTag = document.getElementsByTagName('html')[1]
screen.debug()
console.log('htmlTag', Object.assign({}, htmlTag))
expect(svgTag).toBeInTheDocument()
expect(scriptTag).toBeInTheDocument()
expect(styleTag).toBeInTheDocument()
expect(screen.getByText(/hello world/i)).toBeInTheDocument()
expect(bodyTag).toHaveAttribute('class', 'root')
expect(htmlTag).toHaveAttribute('lang', 'en')
})
})

0 comments on commit 2f69f6a

Please sign in to comment.