remove testData, fix test

This commit is contained in:
Moriz Wahl 2021-05-05 16:53:09 +02:00
parent 54c9665792
commit b3529c0ea3
3 changed files with 8 additions and 58 deletions

View File

@ -103,56 +103,13 @@ export default {
}
},
async updateTransactions() {
// const result = await communityAPI.transactions(this.$store.state.session_id)
// if (result.success) {
// this.GdtBalance = result.result.data.gdtSum / 10000
// this.transactions = result.result.data.transactions
// } else {
// // what to do when loading balance fails?
// }
this.transactions = [
{
name: 'Max Mustermann',
email: 'Maxim@Mustermann',
type: 'send',
transaction_id: 2,
date: '2021-02-19T13:25:38+00:00',
balance: 1920000,
memo: 'a piece of cake :)',
pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7',
},
{
name: 'Bob Bobmann',
email: 'Bob@Bobmann',
type: 'receive',
transaction_id: 3,
date: '2021-03-19T13:27:36+00:00',
balance: 1920000,
memo: 'test text hier eingeben :)',
pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7',
},
{
name: 'Gradido Akademie',
email: 'Gradido@Akademie',
type: 'creation',
transaction_id: 4,
date: '2021-03-22T13:25:36+00:00',
balance: 10000000,
memo: '1000 Gradidos für das Sammeln von Müll im Wald.',
pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7',
},
{
name: 'Verfall',
email: 'Gradido@Akademie',
type: 'decay',
transaction_id: 5,
date: '2021-02-22T13:25:37+00:00',
balance: 20000,
memo: 'verfall',
pubkey: '038a6f93270dc57b91d76bf110ad3863fcb7d1b08e7692e793fcdb4467e5b6a7',
},
]
const result = await communityAPI.transactions(this.$store.state.session_id)
if (result.success) {
this.GdtBalance = result.result.data.gdtSum / 10000
this.transactions = result.result.data.transactions
} else {
// what to do when loading balance fails?
}
},
updateBalance(ammount) {
this.balance -= ammount

View File

@ -35,12 +35,6 @@ describe('KontoOverview', () => {
expect(wrapper.find('gdd-table-stub').exists()).toBeTruthy()
})
it('updates transctions data when update-transactions is emitted', async () => {
wrapper.find('gdd-table-stub').vm.$emit('update-transactions', [0, 1])
await wrapper.vm.$nextTick()
expect(wrapper.vm.transactions).toEqual(expect.arrayContaining([0, 1]))
})
describe('updateBalance method', () => {
beforeEach(async () => {
wrapper.find('gdd-send-stub').vm.$emit('update-balance', {

View File

@ -34,9 +34,8 @@ export default {
props: {
balance: { type: Number, default: 0 },
GdtBalance: { type: Number, default: 0 },
transactions: {
default: [],
default: () => [],
},
},
components: {