diff --git a/web/src/components/Article/Article.test.js b/web/src/components/Article/Article.test.js deleted file mode 100644 index 8870d3025..000000000 --- a/web/src/components/Article/Article.test.js +++ /dev/null @@ -1,18 +0,0 @@ -import { render, screen } from '@redwoodjs/testing' - -import Article from './Article.tsx' - -describe('Article', () => { - it('renders a blog post', () => { - 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(), - } - render(
) - - expect(screen.getByText(article.title)).toBeInTheDocument() - expect(screen.getByText(article.body)).toBeInTheDocument() - }) -}) diff --git a/web/src/components/Article/Article.test.tsx b/web/src/components/Article/Article.test.tsx new file mode 100644 index 000000000..9f2f33957 --- /dev/null +++ b/web/src/components/Article/Article.test.tsx @@ -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(
) + + expect(screen.getByText(ARTICLE.title)).toBeInTheDocument() + expect(screen.getByText(ARTICLE.body)).toBeInTheDocument() + }) + + it('renders a summary of a blog post', () => { + render(
) + + 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() + }) +})