mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Cleanup donations.spec.js
This commit is contained in:
parent
34554f1539
commit
df3d3812cc
@ -1,5 +1,6 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import flushPromises from 'flush-promises'
|
import flushPromises from 'flush-promises'
|
||||||
|
import Vue from 'vue'
|
||||||
import Donations from './donations.vue'
|
import Donations from './donations.vue'
|
||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
@ -15,7 +16,7 @@ describe('donations.vue', () => {
|
|||||||
then: jest.fn(),
|
then: jest.fn(),
|
||||||
catch: jest.fn(),
|
catch: jest.fn(),
|
||||||
})
|
})
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
mocks = {
|
mocks = {
|
||||||
$t: jest.fn((string) => string),
|
$t: jest.fn((string) => string),
|
||||||
@ -105,7 +106,7 @@ describe('donations.vue', () => {
|
|||||||
it.skip('on donations-goal and enter value XXX', async () => {
|
it.skip('on donations-goal and enter value XXX', async () => {
|
||||||
wrapper.find('#donations-goal').setValue('20000')
|
wrapper.find('#donations-goal').setValue('20000')
|
||||||
await wrapper.vm.$nextTick()
|
await wrapper.vm.$nextTick()
|
||||||
console.log(wrapper.find('#donations-goal').element.value)
|
// console.log(wrapper.find('#donations-goal').element.value)
|
||||||
expect(wrapper.vm.formData.goal).toBe('20000')
|
expect(wrapper.vm.formData.goal).toBe('20000')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -115,7 +116,7 @@ describe('donations.vue', () => {
|
|||||||
expect(donationsQueryMock).toHaveBeenCalledTimes(1)
|
expect(donationsQueryMock).toHaveBeenCalledTimes(1)
|
||||||
expect(mocks.$apollo.queries.Donations.refetch).toHaveBeenCalledTimes(1)
|
expect(mocks.$apollo.queries.Donations.refetch).toHaveBeenCalledTimes(1)
|
||||||
// expect(mocks.$apollo.Donations.query().exists()).toBeTruthy()
|
// expect(mocks.$apollo.Donations.query().exists()).toBeTruthy()
|
||||||
console.log('mocks.$apollo: ', mocks.$apollo)
|
// console.log('mocks.$apollo: ', mocks.$apollo)
|
||||||
})
|
})
|
||||||
|
|
||||||
it.skip('query result is displayed', () => {
|
it.skip('query result is displayed', () => {
|
||||||
@ -130,7 +131,7 @@ describe('donations.vue', () => {
|
|||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
jest.clearAllMocks()
|
jest.clearAllMocks()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('calls mutation with default values once', () => {
|
it('calls mutation with default values once', () => {
|
||||||
wrapper.find('.donations-info-button').trigger('submit')
|
wrapper.find('.donations-info-button').trigger('submit')
|
||||||
expect(donationsMutaionMock).toHaveBeenCalledWith(
|
expect(donationsMutaionMock).toHaveBeenCalledWith(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user