Updates tests to 0.21.0 style assertions
This commit is contained in:
@@ -4,19 +4,21 @@ import { standard } from './BlogPostCell.mock'
|
|||||||
|
|
||||||
describe('BlogPostCell', () => {
|
describe('BlogPostCell', () => {
|
||||||
test('Loading renders successfully', () => {
|
test('Loading renders successfully', () => {
|
||||||
|
expect(() => {
|
||||||
render(<Loading />)
|
render(<Loading />)
|
||||||
// Use screen.debug() to see output
|
}).not.toThrow()
|
||||||
expect(screen.getByText('Loading...')).toBeInTheDocument()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Empty renders successfully', async () => {
|
test('Empty renders successfully', async () => {
|
||||||
|
expect(() => {
|
||||||
render(<Empty />)
|
render(<Empty />)
|
||||||
expect(screen.getByText('Empty')).toBeInTheDocument()
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Failure renders successfully', async () => {
|
test('Failure renders successfully', async () => {
|
||||||
|
expect(() => {
|
||||||
render(<Failure error={new Error('Oh no')} />)
|
render(<Failure error={new Error('Oh no')} />)
|
||||||
expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Success renders successfully', async () => {
|
test('Success renders successfully', async () => {
|
||||||
|
|||||||
@@ -4,19 +4,21 @@ import { standard } from './BlogPostsCell.mock'
|
|||||||
|
|
||||||
describe('BlogPostsCell', () => {
|
describe('BlogPostsCell', () => {
|
||||||
test('Loading renders successfully', () => {
|
test('Loading renders successfully', () => {
|
||||||
|
expect(() => {
|
||||||
render(<Loading />)
|
render(<Loading />)
|
||||||
// Use screen.debug() to see output
|
}).not.toThrow()
|
||||||
expect(screen.getByText('Loading...')).toBeInTheDocument()
|
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Empty renders successfully', async () => {
|
test('Empty renders successfully', async () => {
|
||||||
|
expect(() => {
|
||||||
render(<Empty />)
|
render(<Empty />)
|
||||||
expect(screen.getByText('Empty')).toBeInTheDocument()
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Failure renders successfully', async () => {
|
test('Failure renders successfully', async () => {
|
||||||
|
expect(() => {
|
||||||
render(<Failure error={new Error('Oh no')} />)
|
render(<Failure error={new Error('Oh no')} />)
|
||||||
expect(screen.getByText(/Oh no/i)).toBeInTheDocument()
|
}).not.toThrow()
|
||||||
})
|
})
|
||||||
|
|
||||||
test('Success renders successfully', async () => {
|
test('Success renders successfully', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user