Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tktcorporation committed Oct 10, 2022
1 parent 398010e commit 3d74401
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/src/graphql/comments.sdl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const schema = gql`
}
type Query {
comments: [Comment!]! @requireAuth
comments: [Comment!]! @skipAuth
}
input CreateCommentInput {
Expand Down
1 change: 1 addition & 0 deletions web/src/components/CommentsCell/CommentsCell.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ describe('CommentsCell', () => {
it('renders Empty successfully', async () => {
expect(() => {
render(<Empty />)
expect(screen.getByText('No comments yet')).toBeInTheDocument()
}).not.toThrow()
})

Expand Down
4 changes: 3 additions & 1 deletion web/src/components/CommentsCell/CommentsCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export const QUERY = gql`

export const Loading = () => <div>Loading...</div>

export const Empty = () => <div>Empty</div>
export const Empty = () => (
<div className="text-center text-gray-500">No comments yet</div>
)

export const Failure = ({ error }: CellFailureProps) => (
<div style={{ color: 'red' }}>Error: {error?.message}</div>
Expand Down

0 comments on commit 3d74401

Please sign in to comment.