Fix: allow 0 in monetary field (#6658)

This commit is contained in:
shamoon
2024-05-09 10:43:27 -07:00
committed by GitHub
parent 9b3a29cddd
commit 22c8d8ef2a
2 changed files with 15 additions and 2 deletions

View File

@@ -74,4 +74,13 @@ describe('MonetaryComponent', () => {
expect(component.currency).toEqual('USD')
expect(component.monetaryValue).toEqual('')
})
it('should handle zero values', () => {
component.writeValue('USD0.00')
expect(component.currency).toEqual('USD')
expect(component.monetaryValue).toEqual('0.00')
component.monetaryValue = '0'
component.monetaryValueChange()
expect(component.value).toEqual('USD0.00')
})
})