mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-19 01:21:19 +00:00
Fix: consistent monetary field display in list and cards (#6645)
This commit is contained in:
@@ -17,7 +17,7 @@ const document: Document = {
|
||||
title: 'Doc 1',
|
||||
custom_fields: [
|
||||
{ field: 1, document: 1, created: null, value: 'Text value' },
|
||||
{ field: 2, document: 1, created: null, value: '100 USD' },
|
||||
{ field: 2, document: 1, created: null, value: 'USD100' },
|
||||
{ field: 3, document: 1, created: null, value: '1,2,3' },
|
||||
],
|
||||
}
|
||||
@@ -86,4 +86,16 @@ describe('CustomFieldDisplayComponent', () => {
|
||||
expect(title2).toEqual('Document 2')
|
||||
expect(title3).toEqual('Document 3')
|
||||
})
|
||||
|
||||
it('should fallback to default currency', () => {
|
||||
component['defaultCurrencyCode'] = 'EUR' // mock default locale injection
|
||||
component.fieldId = 2
|
||||
component.document = {
|
||||
id: 1,
|
||||
title: 'Doc 1',
|
||||
custom_fields: [{ field: 2, document: 1, created: null, value: '100' }],
|
||||
}
|
||||
expect(component.currency).toEqual('EUR')
|
||||
expect(component.value).toEqual(100)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user