-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use correct, custom formatter in Age component
- Loading branch information
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
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 @@ | ||
Use correct, custom formatter in Age component |
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,20 @@ | ||
import { screen } from '@testing-library/react' | ||
import { renderWithProviders } from '../../../utils/renderWithProviders' | ||
import { Age } from '../' | ||
|
||
describe('RuntimeBlockDetailView', () => { | ||
beforeEach(() => { | ||
jest.useFakeTimers() | ||
jest.setSystemTime(new Date('2024-02-05T10:14:35.000Z')) | ||
}) | ||
|
||
afterEach(() => { | ||
jest.useRealTimers() | ||
}) | ||
|
||
it('should display formatted values', () => { | ||
renderWithProviders(<Age sinceTimestamp={'2024-02-05T10:14:40.000Z'} />) | ||
expect(screen.getByText('5 sec')).toBeInTheDocument() | ||
expect(screen.queryByText('less than a minute')).not.toBeInTheDocument() | ||
}) | ||
}) |
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