-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
d546899
commit 114dee4
Showing
2 changed files
with
30 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
}) | ||
}) |