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', () => { describe('BlogPostCell', () => {
test('Loading renders successfully', () => { test('Loading renders successfully', () => {
render(<Loading />) expect(() => {
// Use screen.debug() to see output render(<Loading />)
expect(screen.getByText('Loading...')).toBeInTheDocument() }).not.toThrow()
}) })
test('Empty renders successfully', async () => { test('Empty renders successfully', async () => {
render(<Empty />) expect(() => {
expect(screen.getByText('Empty')).toBeInTheDocument() render(<Empty />)
}).not.toThrow()
}) })
test('Failure renders successfully', async () => { test('Failure renders successfully', async () => {
render(<Failure error={new Error('Oh no')} />) expect(() => {
expect(screen.getByText(/Oh no/i)).toBeInTheDocument() render(<Failure error={new Error('Oh no')} />)
}).not.toThrow()
}) })
test('Success renders successfully', async () => { test('Success renders successfully', async () => {

View File

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