add test ConfirmRegisterMailFormular.spec.js

This commit is contained in:
ogerly 2021-12-19 18:50:31 +01:00
parent ea4b74e051
commit 578f4835b1
2 changed files with 43 additions and 8 deletions

View File

@ -0,0 +1,40 @@
import { mount } from '@vue/test-utils'
import ConfirmRegisterMailFormular from './ConfirmRegisterMailFormular.vue'
const localVue = global.localVue
const mocks = {
$moment: jest.fn(() => {
return {
format: jest.fn((m) => m),
subtract: jest.fn(() => {
return {
format: jest.fn((m) => m),
}
}),
}
}),
}
const propsData = {
email: '',
dateLastSend: '',
}
describe('ConfirmRegisterMailFormular', () => {
let wrapper
const Wrapper = () => {
return mount(ConfirmRegisterMailFormular, { localVue, mocks, propsData })
}
describe('mount', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('has a DIV element with the class.component-confirm-register-mail', () => {
expect(wrapper.find('.component-confirm-register-mail').exists()).toBeTruthy()
})
})
})

View File

@ -11,7 +11,7 @@
<b-input-group prepend="Email bestätigen, wiederholt senden an:" class="mt-3">
<b-form-input readonly :value="email"></b-form-input>
<b-input-group-append>
<b-button variant="outline-success" @click="sendRegisterMail">
<b-button variant="outline-success" class="test-button" @click="sendRegisterMail">
Registrierungs-Email bestätigen, jetzt senden
</b-button>
</b-input-group-append>
@ -32,15 +32,10 @@ export default {
type: String,
},
},
data() {
return {}
},
methods: {
sendRegisterMail() {
alert(
'sende wiederholt den ConfirmText an die register E-Mail (' + this.email + ') des User!',
)
// eslint-disable-next-line no-console
console.log('sende wiederholt den ConfirmText an die register E-Mail des User!')
},
},
}