Rename BlogPostsCell -> ArticlesCell
This commit is contained in:
33
web/src/components/ArticlesCell/ArticlesCell.test.js
Normal file
33
web/src/components/ArticlesCell/ArticlesCell.test.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import { render, screen } from '@redwoodjs/testing'
|
||||
import { Loading, Empty, Failure, Success } from './ArticlesCell'
|
||||
import { standard } from './ArticlesCell.mock'
|
||||
|
||||
describe('ArticlesCell', () => {
|
||||
test('Loading renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<Loading />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
|
||||
test('Empty renders successfully', async () => {
|
||||
expect(() => {
|
||||
render(<Empty />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
|
||||
test('Failure renders successfully', async () => {
|
||||
expect(() => {
|
||||
render(<Failure error={new Error('Oh no')} />)
|
||||
}).not.toThrow()
|
||||
})
|
||||
|
||||
test('Success renders successfully', async () => {
|
||||
const posts = standard().posts
|
||||
render(<Success posts={posts} />)
|
||||
|
||||
expect(screen.getByText(posts[0].title)).toBeInTheDocument()
|
||||
expect(screen.getByText(posts[0].body)).toBeInTheDocument()
|
||||
expect(screen.getByText(posts[1].title)).toBeInTheDocument()
|
||||
expect(screen.getByText(posts[1].body)).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user