fix unit tests for amout input component

This commit is contained in:
mahula 2023-01-17 11:32:22 +01:00
parent 5e61079e4b
commit b52162320d

View File

@ -46,13 +46,14 @@ describe('InputAmount', () => {
describe('amount normalization', () => {
describe('if invalid', () => {
beforeEach(() => {
beforeEach(async () => {
await wrapper.setProps({ value: '12m34' })
valid = false
})
it('is not normalized', () => {
wrapper.vm.normalizeAmount(valid)
expect(wrapper.vm.amountValue).toBe(0.0)
wrapper.vm.normalizeAmount(false)
expect(wrapper.vm.currentValue).toBe('12m34')
})
})
@ -97,13 +98,14 @@ describe('InputAmount', () => {
describe('amount normalization', () => {
describe('if invalid', () => {
beforeEach(() => {
beforeEach(async () => {
await wrapper.setProps({ value: '12m34' })
valid = false
})
it('is not normalized', () => {
wrapper.vm.normalizeAmount(valid)
expect(wrapper.vm.amountValue).toBe(0.0)
expect(wrapper.vm.currentValue).toBe('12m34')
})
})