Rename BlogPostCell -> ArticleCell
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import BlogPost from 'src/components/BlogPost'
|
import BlogPost from 'src/components/BlogPost'
|
||||||
|
|
||||||
export const QUERY = gql`
|
export const QUERY = gql`
|
||||||
query BlogPostQuery($id: Int!) {
|
query ArticleQuery($id: Int!) {
|
||||||
post(id: $id) {
|
article: post(id: $id) {
|
||||||
id
|
id
|
||||||
title
|
title
|
||||||
body
|
body
|
||||||
@@ -17,6 +17,6 @@ export const Empty = () => <div>Empty</div>
|
|||||||
|
|
||||||
export const Failure = ({ error }) => <div>Error: {error.message}</div>
|
export const Failure = ({ error }) => <div>Error: {error.message}</div>
|
||||||
|
|
||||||
export const Success = ({ post }) => {
|
export const Success = ({ article }) => {
|
||||||
return <BlogPost post={post} />
|
return <Article article={article} />
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Loading, Empty, Failure, Success } from './BlogPostCell'
|
import { Loading, Empty, Failure, Success } from './ArticleCell'
|
||||||
import { standard } from './BlogPostCell.mock'
|
import { standard } from './ArticleCell.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/BlogPostCell' }
|
export default { title: 'Cells/ArticleCell' }
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { render, screen } from '@redwoodjs/testing'
|
import { render, screen } from '@redwoodjs/testing'
|
||||||
import { Loading, Empty, Failure, Success } from './BlogPostCell'
|
import { Loading, Empty, Failure, Success } from './ArticleCell'
|
||||||
import { standard } from './BlogPostCell.mock'
|
import { standard } from './ArticleCell.mock'
|
||||||
|
|
||||||
describe('BlogPostCell', () => {
|
describe('ArticleCell', () => {
|
||||||
test('Loading renders successfully', () => {
|
test('Loading renders successfully', () => {
|
||||||
expect(() => {
|
expect(() => {
|
||||||
render(<Loading />)
|
render(<Loading />)
|
||||||
Reference in New Issue
Block a user