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