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 d546899 commit 114dee4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 18 deletions.
18 changes: 0 additions & 18 deletions web/src/components/Article/Article.test.js

This file was deleted.

30 changes: 30 additions & 0 deletions web/src/components/Article/Article.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { render, screen } from '@redwoodjs/testing'

import Article from './Article'

const ARTICLE = {
id: 1,
title: 'First post',
body: `Neutra tacos hot chicken prism raw denim, put a bird on it enamel pin post-ironic vape cred DIY. Street art next level umami squid. Hammock hexagon glossier 8-bit banjo. Neutra la croix mixtape echo park four loko semiotics kitsch forage chambray. Semiotics salvia selfies jianbing hella shaman. Letterpress helvetica vaporware cronut, shaman butcher YOLO poke fixie hoodie gentrify woke heirloom.`,
createdAt: new Date().toISOString(),
}

describe('Article', () => {
it('renders a blog post', () => {
render(<Article article={ARTICLE} />)

expect(screen.getByText(ARTICLE.title)).toBeInTheDocument()
expect(screen.getByText(ARTICLE.body)).toBeInTheDocument()
})

it('renders a summary of a blog post', () => {
render(<Article article={ARTICLE} summary={true} />)

expect(screen.getByText(ARTICLE.title)).toBeInTheDocument()
expect(
screen.getByText(
'Neutra tacos hot chicken prism raw denim, put a bird on it enamel pin post-ironic vape cred DIY. Str...'
)
).toBeInTheDocument()
})
})

0 comments on commit 114dee4

Please sign in to comment.