Rename BlogPostsCell -> ArticlesCell
This commit is contained in:
@@ -3,7 +3,7 @@ import BlogPost from 'src/components/BlogPost'
|
||||
|
||||
export const QUERY = gql`
|
||||
query BlogPostsQuery {
|
||||
posts {
|
||||
articles: posts {
|
||||
id
|
||||
title
|
||||
body
|
||||
@@ -21,8 +21,8 @@ export const Failure = ({ error }) => <div>Error: {error.message}</div>
|
||||
export const Success = ({ posts }) => {
|
||||
return (
|
||||
<div className="space-y-10">
|
||||
{posts.map((post) => (
|
||||
<BlogPost post={post} key={post.id} />
|
||||
{articles.map((article) => (
|
||||
<Article articles={articles} key={article.id} />
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Loading, Empty, Failure, Success } from './BlogPostsCell'
|
||||
import { standard } from './BlogPostsCell.mock'
|
||||
import { Loading, Empty, Failure, Success } from './ArticlesCell'
|
||||
import { standard } from './ArticlesCell.mock'
|
||||
|
||||
export const loading = () => {
|
||||
return Loading ? <Loading /> : null
|
||||
@@ -17,4 +17,4 @@ export const success = () => {
|
||||
return Success ? <Success {...standard()} /> : null
|
||||
}
|
||||
|
||||
export default { title: 'Cells/BlogPostsCell' }
|
||||
export default { title: 'Cells/ArticlesCell' }
|
||||
@@ -1,8 +1,8 @@
|
||||
import { render, screen } from '@redwoodjs/testing'
|
||||
import { Loading, Empty, Failure, Success } from './BlogPostsCell'
|
||||
import { standard } from './BlogPostsCell.mock'
|
||||
import { Loading, Empty, Failure, Success } from './ArticlesCell'
|
||||
import { standard } from './ArticlesCell.mock'
|
||||
|
||||
describe('BlogPostsCell', () => {
|
||||
describe('ArticlesCell', () => {
|
||||
test('Loading renders successfully', () => {
|
||||
expect(() => {
|
||||
render(<Loading />)
|
||||
Reference in New Issue
Block a user