diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-10-12 17:24:13 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-11-11 18:14:41 +0100 |
| commit | 00f147a7a687d5772bcc538bc606cfff972178cd (patch) | |
| tree | 27eabeb83c05e14162c51b69d4a6f36d461947fc /src/components/organisms/layout/comment.test.tsx | |
| parent | c87c615b5866b8a8f361eeb0764bfdea85740e90 (diff) | |
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.
Diffstat (limited to 'src/components/organisms/layout/comment.test.tsx')
| -rw-r--r-- | src/components/organisms/layout/comment.test.tsx | 10 |
1 files changed, 2 insertions, 8 deletions
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(<UserComment canReply={true} {...data} />); expect( rtlScreen.getByRole('link', { - name: `${formattedDate} at ${formattedTime}`, + name: /\sat\s/, }) ).toHaveAttribute('href', `#comment-${id}`); }); |
