mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
add test ContributionLinkForm
This commit is contained in:
parent
530c65f86f
commit
e3d725ab19
43
admin/src/components/ContributionLinkForm.spec.js
Normal file
43
admin/src/components/ContributionLinkForm.spec.js
Normal file
@ -0,0 +1,43 @@
|
||||
import { mount } from '@vue/test-utils'
|
||||
import ContributionLinkForm from './ContributionLinkForm.vue'
|
||||
|
||||
const localVue = global.localVue
|
||||
|
||||
const propsData = {
|
||||
contributionLinkData: {},
|
||||
}
|
||||
jest.spyOn(window, 'alert').mockReturnValue()
|
||||
|
||||
const mocks = {
|
||||
$t: jest.fn((t) => t),
|
||||
}
|
||||
|
||||
describe('ContributionLinkForm', () => {
|
||||
let wrapper
|
||||
|
||||
const Wrapper = () => {
|
||||
return mount(ContributionLinkForm, { localVue, mocks, propsData })
|
||||
}
|
||||
|
||||
describe('mount', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('renders the Div Element ".contribution-link-form"', () => {
|
||||
expect(wrapper.find('div.contribution-link-form').exists()).toBeTruthy()
|
||||
})
|
||||
|
||||
it('function onSubmit', () => {
|
||||
wrapper.vm.onSubmit()
|
||||
})
|
||||
|
||||
it('function onReset', () => {
|
||||
wrapper.vm.onReset()
|
||||
})
|
||||
|
||||
it('function updateForm', () => {
|
||||
wrapper.vm.updateForm()
|
||||
})
|
||||
})
|
||||
})
|
||||
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="contribution-link-form">
|
||||
<div v-if="updateData" class="text-light bg-info p-3">
|
||||
{{ updateData }}
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user