diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 6a4ef1a3a..a3aeb14a2 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -57,6 +57,7 @@ "at": "am", "cancel": "Abbrechen", "close": "schließen", + "current_balance": "aktueller Kontostand", "date": "Datum", "description": "Beschreibung", "edit": "bearbeiten", @@ -66,6 +67,7 @@ "lastname": "Nachname", "memo": "Nachricht", "message": "Nachricht", + "new_balance": "neuer Kontostand nach Bestätigung", "password": "Passwort", "passwordRepeat": "Passwort wiederholen", "password_new": "neues Passwort", @@ -90,7 +92,8 @@ "is-not": "Du kannst dir selbst keine Gradidos überweisen", "usernmae-regex": "Der Username muss mit einem Buchstaben beginnen auf den mindestens zwei alfanumerische Zeichen folgen müssen.", "usernmae-unique": "Der Username ist bereits vergeben." - } + }, + "your_amount": "Dein Betrag" }, "gdt": { "action": "Aktion", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 52a35a1a9..5ccdfc63b 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -57,6 +57,7 @@ "at": "at", "cancel": "Cancel", "close": "Close", + "current_balance": "current balance", "date": "Date", "description": "Description", "edit": "Edit", @@ -66,6 +67,7 @@ "lastname": "Lastname", "memo": "Message", "message": "Message", + "new_balance": "account balance after confirmation", "password": "Password", "passwordRepeat": "Repeat password", "password_new": "New password", @@ -90,7 +92,8 @@ "is-not": "You cannot send Gradidos to yourself", "usernmae-regex": "The username must start with a letter, followed by at least two alphanumeric characters.", "usernmae-unique": "The username is already taken." - } + }, + "your_amount": "Your amount" }, "gdt": { "action": "Action", diff --git a/frontend/src/views/Pages/SendOverview.spec.js b/frontend/src/views/Pages/SendOverview.spec.js index 16bb6b8d5..429b12baf 100644 --- a/frontend/src/views/Pages/SendOverview.spec.js +++ b/frontend/src/views/Pages/SendOverview.spec.js @@ -13,7 +13,9 @@ describe('SendOverview', () => { const propsData = { balance: 123.45, - transactionCount: 1, + GdtBalance: 1234.56, + transactions: [{ balance: 0.1 }], + pending: true, } const mocks = { @@ -42,18 +44,16 @@ describe('SendOverview', () => { expect(wrapper.find('div.gdd-send').exists()).toBeTruthy() }) - // it('has a transactions table', () => { - // expect(wrapper.find('div.gdd-transaction-list').exists()).toBeTruthy() - // }) - describe('transaction form', () => { - it('steps forward in the dialog', async () => { - await wrapper.findComponent({ name: 'TransactionForm' }).vm.$emit('set-transaction', { + beforeEach(async () => { + wrapper.findComponent({ name: 'TransactionForm' }).vm.$emit('set-transaction', { email: 'user@example.org', amount: 23.45, memo: 'Make the best of it!', }) - expect(wrapper.findComponent({ name: 'TransactionConfirmation' }).exists()).toBeTruthy() + }) + it('steps forward in the dialog', () => { + expect(wrapper.findComponent({ name: 'TransactionConfirmation' }).exists()).toBe(true) }) }) @@ -112,18 +112,22 @@ describe('SendOverview', () => { describe('transaction is confirmed and server response is error', () => { beforeEach(async () => { jest.clearAllMocks() - sendMock.mockRejectedValue({ message: 'receiver not found' }) + sendMock.mockRejectedValue({ message: 'recipiant not known' }) await wrapper .findComponent({ name: 'TransactionConfirmation' }) .vm.$emit('send-transaction') }) it('shows the error page', () => { - expect(wrapper.find('div.card-body').text()).toContain('form.send_transaction_error') + expect(wrapper.find('.test-send_transaction_error').text()).toContain( + 'form.send_transaction_error', + ) }) it('shows recipient not found', () => { - expect(wrapper.text()).toContain('transaction.receiverNotFound') + expect(wrapper.find('.test-receiver-not-found').text()).toContain( + 'transaction.receiverNotFound', + ) }) }) }) diff --git a/frontend/src/views/Pages/SendOverview.vue b/frontend/src/views/Pages/SendOverview.vue index 822cc3117..08f2f0159 100644 --- a/frontend/src/views/Pages/SendOverview.vue +++ b/frontend/src/views/Pages/SendOverview.vue @@ -1,12 +1,14 @@