Fixed format date unit test (#6469)

With the introduction of the new function formatToHumanReadableTime, we
had to modify a unit test that wasn't using a UTC date as input data.
This commit is contained in:
Lucas Bordeau 2024-07-31 11:50:55 +02:00 committed by GitHub
parent 7fe00b163e
commit db2cb2bc2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,8 +22,9 @@ describe('formatToHumanReadableDay', () => {
describe('formatToHumanReadableTime', () => {
it('should format the date to a human-readable time', () => {
const date = new Date('2022-01-01T12:30:00');
const date = new Date('2022-01-01T12:30:00Z');
const result = formatToHumanReadableTime(date, 'UTC');
// it seems when running locally on MacOS the space is not the same
expect(['12:30 PM', '12:30PM']).toContain(result);
});