Skip to content

Commit

Permalink
Fix relative date test that will fail across months
Browse files Browse the repository at this point in the history
  • Loading branch information
shamoon committed May 1, 2024
1 parent 5ea0f8a commit c62d9d9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src-ui/src/app/pipes/custom-date.pipe.spec.ts
Expand Up @@ -33,8 +33,9 @@ describe('CustomDatePipe', () => {
const notNow = new Date(now)
notNow.setDate(now.getDate() - 1)
expect(datePipe.transform(notNow, 'relative')).toEqual('1 day ago')
notNow.setDate(now.getDate() - 2)
expect(datePipe.transform(notNow, 'relative')).toEqual('2 days ago')
notNow.setDate(now.getDate())
notNow.setMonth(now.getMonth() - 1)
expect(datePipe.transform(notNow, 'relative')).toEqual('1 month ago')
expect(datePipe.transform(now, 'relative')).toEqual('Just now')
})
})

0 comments on commit c62d9d9

Please sign in to comment.