From bcd217e1d9fb4de3389c6dd8904123799b98aa75 Mon Sep 17 00:00:00 2001 From: Rob Cameron Date: Tue, 8 Feb 2022 14:59:00 -0800 Subject: [PATCH] Rename BlogPostCell -> ArticleCell --- .../BlogPostCell.js => ArticleCell/ArticleCell.js} | 8 ++++---- .../ArticleCell.mock.js} | 0 .../ArticleCell.stories.js} | 6 +++--- .../ArticleCell.test.js} | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) rename web/src/components/{BlogPostCell/BlogPostCell.js => ArticleCell/ArticleCell.js} (68%) rename web/src/components/{BlogPostCell/BlogPostCell.mock.js => ArticleCell/ArticleCell.mock.js} (100%) rename web/src/components/{BlogPostCell/BlogPostCell.stories.js => ArticleCell/ArticleCell.stories.js} (67%) rename web/src/components/{BlogPostCell/BlogPostCell.test.js => ArticleCell/ArticleCell.test.js} (82%) diff --git a/web/src/components/BlogPostCell/BlogPostCell.js b/web/src/components/ArticleCell/ArticleCell.js similarity index 68% rename from web/src/components/BlogPostCell/BlogPostCell.js rename to web/src/components/ArticleCell/ArticleCell.js index fd7987f..2ab37e6 100644 --- a/web/src/components/BlogPostCell/BlogPostCell.js +++ b/web/src/components/ArticleCell/ArticleCell.js @@ -1,8 +1,8 @@ import BlogPost from 'src/components/BlogPost' export const QUERY = gql` - query BlogPostQuery($id: Int!) { - post(id: $id) { + query ArticleQuery($id: Int!) { + article: post(id: $id) { id title body @@ -17,6 +17,6 @@ export const Empty = () =>
Empty
export const Failure = ({ error }) =>
Error: {error.message}
-export const Success = ({ post }) => { - return +export const Success = ({ article }) => { + return
} diff --git a/web/src/components/BlogPostCell/BlogPostCell.mock.js b/web/src/components/ArticleCell/ArticleCell.mock.js similarity index 100% rename from web/src/components/BlogPostCell/BlogPostCell.mock.js rename to web/src/components/ArticleCell/ArticleCell.mock.js diff --git a/web/src/components/BlogPostCell/BlogPostCell.stories.js b/web/src/components/ArticleCell/ArticleCell.stories.js similarity index 67% rename from web/src/components/BlogPostCell/BlogPostCell.stories.js rename to web/src/components/ArticleCell/ArticleCell.stories.js index 597ce5f..abc6e27 100644 --- a/web/src/components/BlogPostCell/BlogPostCell.stories.js +++ b/web/src/components/ArticleCell/ArticleCell.stories.js @@ -1,5 +1,5 @@ -import { Loading, Empty, Failure, Success } from './BlogPostCell' -import { standard } from './BlogPostCell.mock' +import { Loading, Empty, Failure, Success } from './ArticleCell' +import { standard } from './ArticleCell.mock' export const loading = () => { return Loading ? : null @@ -17,4 +17,4 @@ export const success = () => { return Success ? : null } -export default { title: 'Cells/BlogPostCell' } +export default { title: 'Cells/ArticleCell' } diff --git a/web/src/components/BlogPostCell/BlogPostCell.test.js b/web/src/components/ArticleCell/ArticleCell.test.js similarity index 82% rename from web/src/components/BlogPostCell/BlogPostCell.test.js rename to web/src/components/ArticleCell/ArticleCell.test.js index b0c8030..a669710 100644 --- a/web/src/components/BlogPostCell/BlogPostCell.test.js +++ b/web/src/components/ArticleCell/ArticleCell.test.js @@ -1,8 +1,8 @@ import { render, screen } from '@redwoodjs/testing' -import { Loading, Empty, Failure, Success } from './BlogPostCell' -import { standard } from './BlogPostCell.mock' +import { Loading, Empty, Failure, Success } from './ArticleCell' +import { standard } from './ArticleCell.mock' -describe('BlogPostCell', () => { +describe('ArticleCell', () => { test('Loading renders successfully', () => { expect(() => { render()