Skip to content

Commit

Permalink
fix: use UTC in tests dates
Browse files Browse the repository at this point in the history
  • Loading branch information
DiogoSoaress committed Jan 18, 2024
1 parent 1f86e67 commit 50908f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Blog/utils/__test__/formatBlogDate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,28 @@ import { formatBlogDate } from '@/components/Blog/utils/formatBlogDate'

describe('formatBlogDate', () => {
it('formats a valid date with a st day suffix', () => {
const inputDate = '2023-12-01T00:00+01:00'
const inputDate = '2023-12-01T00:00+00:00'
const formattedDate = formatBlogDate(inputDate)

expect(formattedDate).toBe('1st December, 2023')
})

it('formats a valid date with a nd day suffix', () => {
const inputDate = '2023-12-02T00:00+01:00'
const inputDate = '2023-12-02T00:00+00:00'
const formattedDate = formatBlogDate(inputDate)

expect(formattedDate).toBe('2nd December, 2023')
})

it('formats a valid date with a rd day suffix', () => {
const inputDate = '2023-12-03T00:00+01:00'
const inputDate = '2023-12-03T00:00+00:00'
const formattedDate = formatBlogDate(inputDate)

expect(formattedDate).toBe('3rd December, 2023')
})

it('formats a valid date with a th day suffix', () => {
const inputDate = '2023-12-08T00:00+01:00'
const inputDate = '2023-12-08T00:00+00:00'
const formattedDate = formatBlogDate(inputDate)

expect(formattedDate).toBe('8th December, 2023')
Expand Down

0 comments on commit 50908f2

Please sign in to comment.