From 0d59a6d2995b4119865271ed1908ede0bb96497c Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Mon, 9 May 2022 18:19:38 +0200 Subject: refactor: rewrite DescriptionList and Meta components The meta can have different layout. The previous implementation was not enough to easily change the layout. Also, I prefer to restrict the meta types and it prevents me to repeat myself for the labels. --- src/components/organisms/layout/summary.test.tsx | 27 +++++++++++------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'src/components/organisms/layout/summary.test.tsx') diff --git a/src/components/organisms/layout/summary.test.tsx b/src/components/organisms/layout/summary.test.tsx index 4944805..09b797c 100644 --- a/src/components/organisms/layout/summary.test.tsx +++ b/src/components/organisms/layout/summary.test.tsx @@ -12,20 +12,17 @@ const excerpt = 'Perspiciatis quasi libero nemo non eligendi nam minima. Deleniti expedita tempore. Praesentium explicabo molestiae eaque consectetur vero. Quae nostrum quisquam similique. Ut hic est quas ut esse quisquam nobis.'; const meta = { - publication: { name: 'Published on:', value: 'April 11th 2022' }, - readingTime: { name: 'Reading time:', value: '5 minutes' }, - categories: { - name: 'Categories:', - value: [ - - Cat 1 - , - - Cat 2 - , - ], - }, - comments: { name: 'Comments:', value: '1 comment' }, + publication: { date: '2022-04-11' }, + readingTime: '5 minutes', + thematics: [ + + Cat 1 + , + + Cat 2 + , + ], + commentsCount: '1 comment', }; const title = 'Odio odit necessitatibus'; @@ -80,6 +77,6 @@ describe('Summary', () => { it('renders some meta', () => { render(); - expect(screen.getByText(meta.publication.name)).toBeInTheDocument(); + expect(screen.getByText(meta.readingTime)).toBeInTheDocument(); }); }); -- cgit v1.2.3