fix test, linting

This commit is contained in:
Moriz Wahl 2021-08-10 15:42:30 +02:00
parent 281a6beadd
commit ad12dd46f4
3 changed files with 25 additions and 17 deletions

View File

@ -144,14 +144,14 @@ export default {
}
},
async updateGdt() {
const result2 = await communityAPI.transactionsgdt(this.$store.state.sessionId)
console.log(' communityAPI.transactionsgdt')
console.log(result2.result)
console.log(result2.result.data.gdtEntries)
this.GdtBalance = Number(result2.result.data.gdtSum)
this.transactionsGdt = result2.result.data.gdtEntries
this.transactionGdtCount = result2.result.data.count
/*
const result2 = await communityAPI.transactionsgdt(this.$store.state.sessionId)
// console.log(' communityAPI.transactionsgdt')
// console.log(result2.result)
// console.log(result2.result.data.gdtEntries)
this.GdtBalance = Number(result2.result.data.gdtSum)
this.transactionsGdt = result2.result.data.gdtEntries
this.transactionGdtCount = result2.result.data.count
/*
this.transactionsGdt =
{
state: 'success',
@ -213,7 +213,7 @@ export default {
count: 4,
}
*/
//this.transactionGdtCount = this.transactionsGdt.count
// this.transactionGdtCount = this.transactionsGdt.count
// console.log('transactionGdtCount', this.transactionGdtCount)
},
updateBalance(ammount) {

View File

@ -18,14 +18,12 @@
:key="id"
>
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1"> Gradido Transform (GDT) erhalten {{ comment ? ': '+comment : '' }}</h5>
<h5 class="mb-1">Gradido Transform (GDT) erhalten {{ comment ? ': ' + comment : '' }}</h5>
<small>{{ $d($moment(date), 'long') }} {{ $i18n.locale === 'de' ? 'Uhr' : '' }}</small>
</div>
<div v-if="gdt_entry_type_id === 7">{{ amount }} GDT * {{factor}} = {{gdt}}</div>
<div v-else>{{ amount }} {{ gdt}} GDT</div>
<div v-if="gdt_entry_type_id === 7">{{ amount }} GDT * {{ factor }} = {{ gdt }}</div>
<div v-else>{{ amount }} {{ gdt }} GDT</div>
<small>
{{ id }} {{ amount }} {{ date }} {{ email }} {{ comment }} {{ coupon_code }}
{{ gdt_entry_type_id }} {{ factor }} {{ amount2 }} {{ factor2 }} {{ gdt }}

View File

@ -1,8 +1,18 @@
import { shallowMount } from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import UserProfileTransactionList from './UserProfileTransactionList'
const localVue = global.localVue
const mutationObserverMock = jest.fn(function MutationObserver(callback) {
this.observe = jest.fn()
this.disconnect = jest.fn()
this.trigger = (mockedMutationsList) => {
callback(mockedMutationsList, this)
}
})
global.MutationObserver = mutationObserverMock
describe('UserProfileTransactionList', () => {
let wrapper
@ -12,7 +22,7 @@ describe('UserProfileTransactionList', () => {
}
const Wrapper = () => {
return shallowMount(UserProfileTransactionList, { localVue, mocks })
return mount(UserProfileTransactionList, { localVue, mocks })
}
describe('mount', () => {
@ -25,7 +35,7 @@ describe('UserProfileTransactionList', () => {
})
it('emits update-transactions after creation', () => {
expect(wrapper.emitted('update-transactions')).toEqual(
expect(wrapper.emitted('update-transactions')).toEqual(
expect.arrayContaining([expect.arrayContaining([{ firstPage: 1, items: 25 }])]),
)
})