Merge pull request #6359 from Ocelot-Social-Community/fix-webapp-unit-tests

fix(webapp): warnings in unit tests
This commit is contained in:
Moriz Wahl 2023-06-05 12:45:51 +02:00 committed by GitHub
commit 87fcaad490
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,8 @@
import { mount } from '@vue/test-utils'
import InviteButton from './InviteButton.vue'
const localVue = global.localVue
const stubs = {
'v-popover': {
template: '<span><slot /></span>',
@ -26,7 +28,7 @@ describe('InviteButton.vue', () => {
describe('mount', () => {
const Wrapper = () => {
return mount(InviteButton, { mocks, propsData, stubs })
return mount(InviteButton, { mocks, localVue, propsData, stubs })
}
beforeEach(() => {

View File

@ -18,9 +18,13 @@ describe('create.vue', () => {
},
}
const stubs = {
ContributionForm: true,
}
describe('mount', () => {
const Wrapper = () => {
return mount(create, { mocks, localVue })
return mount(create, { mocks, localVue, stubs })
}
beforeEach(() => {
@ -28,7 +32,7 @@ describe('create.vue', () => {
})
it('renders', () => {
expect(wrapper.findAll('.contribution-form')).toHaveLength(1)
expect(wrapper.findComponent({ name: 'ContributionForm' }).exists()).toBe(true)
})
})
})