mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix tests
This commit is contained in:
parent
c170c48ac4
commit
9efb83b2af
@ -11,7 +11,7 @@ describe('ContributionForm', () => {
|
||||
$d: jest.fn((d) => d),
|
||||
$store: {
|
||||
state: {
|
||||
creation: ["1000","1000","1000"],
|
||||
creation: ['1000', '1000', '1000'],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -57,23 +57,23 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
type() {
|
||||
if (this.deletedAt !== null) return 'deleted'
|
||||
if (this.confirmedAt !== null) return 'confirmed'
|
||||
if (this.deletedAt) return 'deleted'
|
||||
if (this.confirmedAt) return 'confirmed'
|
||||
return 'pending'
|
||||
},
|
||||
icon() {
|
||||
if (this.deletedAt !== null) return 'x-circle'
|
||||
if (this.confirmedAt !== null) return 'check'
|
||||
if (this.deletedAt) return 'x-circle'
|
||||
if (this.confirmedAt) return 'check'
|
||||
return 'bell-fill'
|
||||
},
|
||||
variant() {
|
||||
if (this.deletedAt !== null) return 'danger'
|
||||
if (this.confirmedAt !== null) return 'success'
|
||||
if (this.deletedAt) return 'danger'
|
||||
if (this.confirmedAt) return 'success'
|
||||
return 'primary'
|
||||
},
|
||||
date() {
|
||||
if (this.deletedAt !== null) return this.deletedAt
|
||||
if (this.confirmedAt !== null) return this.confirmedAt
|
||||
if (this.deletedAt) return this.deletedAt
|
||||
if (this.confirmedAt) return this.confirmedAt
|
||||
return this.createdAt
|
||||
},
|
||||
},
|
||||
|
||||
@ -4,8 +4,23 @@ import Community from './Community'
|
||||
const localVue = global.localVue
|
||||
|
||||
const mockStoreDispach = jest.fn()
|
||||
const apolloQueryMock = jest.fn()
|
||||
const apolloMutationMock = jest.fn()
|
||||
apolloMutationMock.mockResolvedValue('success')
|
||||
apolloQueryMock.mockResolvedValue({
|
||||
data: {
|
||||
listContributions: [
|
||||
{
|
||||
id: 1555,
|
||||
amount: '200',
|
||||
memo: 'Fleisig, fleisig am Arbeiten mein Lieber Freund, 50 Zeichen sind viel',
|
||||
createdAt: '2022-07-15T08:47:06.000Z',
|
||||
deletedAt: null,
|
||||
confirmedBy: null,
|
||||
confirmedAt: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
|
||||
describe('Community', () => {
|
||||
let wrapper
|
||||
@ -14,10 +29,14 @@ describe('Community', () => {
|
||||
$t: jest.fn((t) => t),
|
||||
$d: jest.fn((d) => d),
|
||||
$apollo: {
|
||||
query: apolloQueryMock,
|
||||
mutate: apolloMutationMock,
|
||||
},
|
||||
$store: {
|
||||
dispatch: mockStoreDispach,
|
||||
state: {
|
||||
creation: ['1000', '1000', '1000'],
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -73,7 +73,7 @@ export default {
|
||||
this.toastError(err.message)
|
||||
})
|
||||
},
|
||||
async updateListContributions(pagination) {
|
||||
updateListContributions(pagination) {
|
||||
this.$apollo
|
||||
.query({
|
||||
fetchPolicy: 'no-cache',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user