diff --git a/frontend/src/components/TransactionRows/DurationRow.vue b/frontend/src/components/TransactionRows/DurationRow.vue
index 9cadf8c24..6f62d9dc5 100644
--- a/frontend/src/components/TransactionRows/DurationRow.vue
+++ b/frontend/src/components/TransactionRows/DurationRow.vue
@@ -4,13 +4,18 @@
{{ $t('decay.past_time') }}
-
- {{ durationText }}
+
+ {{ duration }}
diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json
index b8635f44a..a5357e6d9 100644
--- a/frontend/src/locales/de.json
+++ b/frontend/src/locales/de.json
@@ -89,6 +89,8 @@
"decay_introduced": "Die Vergänglichkeit wurde eingeführt am:",
"decay_since_last_transaction": "Vergänglichkeit seit der letzten Transaktion",
"last_transaction": "Letzte Transaktion",
+ "new_balance": "Neuer Kontostand",
+ "old_balance": "Vorheriger Kontostand",
"past_time": "Vergangene Zeit",
"Starting_block_decay": "Startblock Vergänglichkeit",
"total": "Gesamt",
diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json
index 15449a208..42f22f709 100644
--- a/frontend/src/locales/en.json
+++ b/frontend/src/locales/en.json
@@ -89,6 +89,8 @@
"decay_introduced": "Decay was introduced on:",
"decay_since_last_transaction": "Decay since the last transaction",
"last_transaction": "Last transaction:",
+ "new_balance": "New balance",
+ "old_balance": "Previous balance",
"past_time": "Time passed",
"Starting_block_decay": "Starting Block Decay",
"total": "Total",
diff --git a/frontend/src/pages/Community.spec.js b/frontend/src/pages/Community.spec.js
index 28d742fe9..ab1572d37 100644
--- a/frontend/src/pages/Community.spec.js
+++ b/frontend/src/pages/Community.spec.js
@@ -72,6 +72,7 @@ describe('Community', () => {
messagesCount: 0,
deniedAt: null,
deniedBy: null,
+ moderatorId: null,
},
{
id: 1550,
@@ -88,6 +89,7 @@ describe('Community', () => {
messagesCount: 0,
deniedAt: null,
deniedBy: null,
+ moderatorId: null,
},
],
contributionCount: 1,
diff --git a/frontend/src/pages/Community.vue b/frontend/src/pages/Community.vue
index 20e7d3fe6..4388d6f4a 100644
--- a/frontend/src/pages/Community.vue
+++ b/frontend/src/pages/Community.vue
@@ -196,7 +196,9 @@ export default {
methods: {
updateTabIndex() {
const index = COMMUNITY_TABS.indexOf(this.$route.params.tab)
- this.tabIndex = index > -1 ? index : 0
+ this.$nextTick(() => {
+ this.tabIndex = index > -1 ? index : 0
+ })
this.closeAllOpenCollapse()
},
closeAllOpenCollapse() {
diff --git a/frontend/src/pages/Send.spec.js b/frontend/src/pages/Send.spec.js
index 0a0d5da71..3aae5a83e 100644
--- a/frontend/src/pages/Send.spec.js
+++ b/frontend/src/pages/Send.spec.js
@@ -10,6 +10,7 @@ const apolloMutationMock = jest.fn()
apolloMutationMock.mockResolvedValue('success')
const navigatorClipboardMock = jest.fn()
+const routerPushMock = jest.fn()
const localVue = global.localVue
@@ -38,6 +39,9 @@ describe('Send', () => {
$route: {
query: {},
},
+ $router: {
+ push: routerPushMock,
+ },
}
const Wrapper = () => {
@@ -85,8 +89,8 @@ describe('Send', () => {
it('shows the transaction formular again', () => {
expect(wrapper.findComponent({ name: 'TransactionForm' }).exists()).toBe(true)
})
- // TODO:SKIPED at this point, a check must be made in the components ?
- it.skip('restores the previous data in the formular', () => {
+
+ it('restores the previous data in the formular', () => {
expect(wrapper.find("input[type='email']").vm.$el.value).toBe('user@example.org')
expect(wrapper.find("input[type='text']").vm.$el.value).toBe('23.45')
expect(wrapper.find('textarea').vm.$el.value).toBe('Make the best of it!')
@@ -107,10 +111,11 @@ describe('Send', () => {
expect.objectContaining({
mutation: sendCoins,
variables: {
- email: 'user@example.org',
+ identifier: 'user@example.org',
amount: 23.45,
memo: 'Make the best of it!',
selected: SEND_TYPES.send,
+ userName: '',
},
}),
)
@@ -162,6 +167,67 @@ describe('Send', () => {
})
})
+ describe('with gradidoID query', () => {
+ beforeEach(() => {
+ mocks.$route.query.gradidoID = 'gradido-ID'
+ wrapper = Wrapper()
+ })
+
+ it('has no email input field', () => {
+ expect(
+ wrapper.findComponent({ name: 'TransactionForm' }).find('input[type="email"]').exists(),
+ ).toBe(false)
+ })
+
+ describe('submit form', () => {
+ beforeEach(async () => {
+ jest.clearAllMocks()
+ const transactionForm = wrapper.findComponent({ name: 'TransactionForm' })
+ await transactionForm.find('input[type="text"]').setValue('34.56')
+ await transactionForm.find('textarea').setValue('Make the best of it!')
+ await transactionForm.find('form').trigger('submit')
+ await flushPromises()
+ })
+
+ it('steps forward in the dialog', () => {
+ expect(wrapper.findComponent({ name: 'TransactionConfirmationSend' }).exists()).toBe(true)
+ })
+
+ describe('confirm transaction', () => {
+ beforeEach(async () => {
+ jest.clearAllMocks()
+ await wrapper
+ .findComponent({ name: 'TransactionConfirmationSend' })
+ .find('button.btn-gradido')
+ .trigger('click')
+ })
+
+ it('calls the API', async () => {
+ expect(apolloMutationMock).toBeCalledWith(
+ expect.objectContaining({
+ mutation: sendCoins,
+ variables: {
+ identifier: 'gradido-ID',
+ amount: 34.56,
+ memo: 'Make the best of it!',
+ selected: SEND_TYPES.send,
+ userName: '',
+ },
+ }),
+ )
+ })
+
+ it('resets the gradido ID query in route', () => {
+ expect(routerPushMock).toBeCalledWith({
+ query: {
+ gradidoID: undefined,
+ },
+ })
+ })
+ })
+ })
+ })
+
describe('transaction form link', () => {
const now = new Date().toISOString()
beforeEach(async () => {
diff --git a/frontend/src/pages/Send.vue b/frontend/src/pages/Send.vue
index 65677ecdd..30ffc06ed 100644
--- a/frontend/src/pages/Send.vue
+++ b/frontend/src/pages/Send.vue
@@ -11,9 +11,7 @@
@@ -21,7 +19,7 @@