Rename BlogPostsCell -> ArticlesCell

This commit is contained in:
Rob Cameron
2022-02-08 15:00:33 -08:00
parent bcd217e1d9
commit 82cc078d74
5 changed files with 9 additions and 9 deletions

View 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()
})
})