Updates tests to 0.21.0 style assertions

This commit is contained in:
Rob Cameron
2020-10-26 16:52:15 -07:00
parent ef82a59b6e
commit 7e74567326
2 changed files with 18 additions and 14 deletions

View File

@@ -4,19 +4,21 @@ import { standard } from './BlogPostCell.mock'
describe('BlogPostCell', () => {
test('Loading renders successfully', () => {
expect(() => {
render(<Loading />)
// Use screen.debug() to see output
expect(screen.getByText('Loading...')).toBeInTheDocument()
}).not.toThrow()
})
test('Empty renders successfully', async () => {
expect(() => {
render(<Empty />)
expect(screen.getByText('Empty')).toBeInTheDocument()
}).not.toThrow()
})
test('Failure renders successfully', async () => {
expect(() => {
render(<Failure error={new Error('Oh no')} />)
expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
}).not.toThrow()
})
test('Success renders successfully', async () => {

View File

@@ -4,19 +4,21 @@ import { standard } from './BlogPostsCell.mock'
describe('BlogPostsCell', () => {
test('Loading renders successfully', () => {
expect(() => {
render(<Loading />)
// Use screen.debug() to see output
expect(screen.getByText('Loading...')).toBeInTheDocument()
}).not.toThrow()
})
test('Empty renders successfully', async () => {
expect(() => {
render(<Empty />)
expect(screen.getByText('Empty')).toBeInTheDocument()
}).not.toThrow()
})
test('Failure renders successfully', async () => {
expect(() => {
render(<Failure error={new Error('Oh no')} />)
expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
}).not.toThrow()
})
test('Success renders successfully', async () => {