diff --git a/frontend/src/components/GddSend/TransactionForm.vue b/frontend/src/components/GddSend/TransactionForm.vue index b2dd4a5a7..d11347c45 100644 --- a/frontend/src/components/GddSend/TransactionForm.vue +++ b/frontend/src/components/GddSend/TransactionForm.vue @@ -151,12 +151,12 @@ export default { this.form.amount = '' this.form.memo = '' }, - normalizeAmount(isValid) { - this.amountFocused = false - if (!isValid) return - this.form.amountValue = Number(this.form.amount.replace(',', '.')) - this.form.amount = this.$n(this.form.amountValue, 'ungroupedDecimal') - }, + // normalizeAmount(isValid) { + // this.amountFocused = false + // if (!isValid) return + // this.form.amountValue = Number(this.form.amount.replace(',', '.')) + // this.form.amount = this.$n(this.form.amountValue, 'ungroupedDecimal') + // }, normalizeEmail() { this.emailFocused = false this.form.email = this.form.email.trim() diff --git a/frontend/src/components/Inputs/FirstName.spec.js b/frontend/src/components/Inputs/FirstName.spec.js new file mode 100644 index 000000000..070850dbd --- /dev/null +++ b/frontend/src/components/Inputs/FirstName.spec.js @@ -0,0 +1,38 @@ +import { mount } from '@vue/test-utils' +import FirstName from './FirstName' + +const localVue = global.localVue + +describe('FirstName', () => { + let wrapper + + const mocks = { + $t: jest.fn((t) => t), + $i18n: { + locale: jest.fn(() => 'en'), + }, + $n: jest.fn((n) => String(n)), + } + + const propsData = { + balance: 0.0, + } + + const Wrapper = () => { + return mount(FirstName, { + localVue, + mocks, + propsData, + }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component', () => { + expect(wrapper.find('div.first-name').exists()).toBe(true) + }) + }) +}) diff --git a/frontend/src/components/Inputs/InputAmount.spec.js b/frontend/src/components/Inputs/InputAmount.spec.js new file mode 100644 index 000000000..f2fc48888 --- /dev/null +++ b/frontend/src/components/Inputs/InputAmount.spec.js @@ -0,0 +1,41 @@ +import { mount } from '@vue/test-utils' +import InputAmount from './InputAmount' + +const localVue = global.localVue + +describe('InputAmount', () => { + let wrapper + + const mocks = { + $t: jest.fn((t) => t), + $i18n: { + locale: jest.fn(() => 'en'), + }, + $n: jest.fn((n) => String(n)), + } + + const propsData = { + name: '', + label: '', + placeholder: '', + value: '', + } + + const Wrapper = () => { + return mount(InputAmount, { + localVue, + mocks, + propsData, + }) + } + + describe('mount', () => { + beforeEach(() => { + wrapper = Wrapper() + }) + + it('renders the component input-amount', () => { + expect(wrapper.find('div.input-amount').exists()).toBe(true) + }) + }) +}) diff --git a/frontend/src/components/Inputs/InputAmount.vue b/frontend/src/components/Inputs/InputAmount.vue index 9270e38a8..b7c7c0da4 100644 --- a/frontend/src/components/Inputs/InputAmount.vue +++ b/frontend/src/components/Inputs/InputAmount.vue @@ -1,29 +1,31 @@