From 00f147a7a687d5772bcc538bc606cfff972178cd Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Thu, 12 Oct 2023 17:24:13 +0200 Subject: feat(components): add a Time component Instead of using helpers functions to format the date each time we need to use a time element, it makes more sense to create a new component dedicated to this task. --- src/components/organisms/layout/comment.test.tsx | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/components/organisms/layout/comment.test.tsx') diff --git a/src/components/organisms/layout/comment.test.tsx b/src/components/organisms/layout/comment.test.tsx index b64f84a..0e0ea3a 100644 --- a/src/components/organisms/layout/comment.test.tsx +++ b/src/components/organisms/layout/comment.test.tsx @@ -1,13 +1,7 @@ import { describe, expect, it } from '@jest/globals'; import { render, screen as rtlScreen } from '../../../../tests/utils'; import { UserComment } from './comment'; -import { - author, - data, - formattedDate, - formattedTime, - id, -} from './comment.fixture'; +import { author, data, id } from './comment.fixture'; describe('UserComment', () => { it('renders an avatar', () => { @@ -29,7 +23,7 @@ describe('UserComment', () => { render(); expect( rtlScreen.getByRole('link', { - name: `${formattedDate} at ${formattedTime}`, + name: /\sat\s/, }) ).toHaveAttribute('href', `#comment-${id}`); }); -- cgit v1.2.3