mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
Fix relative date test that will fail across months
This commit is contained in:
parent
8b4fc02955
commit
8d516c08f0
1 changed files with 3 additions and 2 deletions
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue