mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch '1197-admin-interface-created-transactions-list' of https://github.com/gradido/gradido into 1197-admin-interface-created-transactions-list
This commit is contained in:
commit
5a68eef493
@ -4,21 +4,17 @@ import ConfirmRegisterMailFormular from './ConfirmRegisterMailFormular.vue'
|
|||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
const apolloMutateMock = jest.fn().mockResolvedValue()
|
const apolloMutateMock = jest.fn().mockResolvedValue()
|
||||||
|
const toastSuccessMock = jest.fn()
|
||||||
|
const toastErrorMock = jest.fn()
|
||||||
|
|
||||||
const mocks = {
|
const mocks = {
|
||||||
$moment: jest.fn(() => {
|
|
||||||
return {
|
|
||||||
format: jest.fn((m) => m),
|
|
||||||
subtract: jest.fn(() => {
|
|
||||||
return {
|
|
||||||
format: jest.fn((m) => m),
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
$apollo: {
|
$apollo: {
|
||||||
mutate: apolloMutateMock,
|
mutate: apolloMutateMock,
|
||||||
},
|
},
|
||||||
|
$toasted: {
|
||||||
|
success: toastSuccessMock,
|
||||||
|
error: toastErrorMock,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
const propsData = {
|
const propsData = {
|
||||||
@ -47,8 +43,18 @@ describe('ConfirmRegisterMailFormular', () => {
|
|||||||
wrapper.find('button.test-button').trigger('click')
|
wrapper.find('button.test-button').trigger('click')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('calls the API', () => {
|
it('calls the API with email', () => {
|
||||||
expect(apolloMutateMock).toBeCalled()
|
expect(apolloMutateMock).toBeCalledWith(
|
||||||
|
expect.objectContaining({
|
||||||
|
variables: { email: 'bob@baumeister.de' },
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('toasts a success message', () => {
|
||||||
|
expect(toastSuccessMock).toBeCalledWith(
|
||||||
|
'Erfolgreich senden der Confirmation Link an die E-Mail des Users! bob@baumeister.de',
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -59,8 +65,10 @@ describe('ConfirmRegisterMailFormular', () => {
|
|||||||
wrapper.find('button.test-button').trigger('click')
|
wrapper.find('button.test-button').trigger('click')
|
||||||
})
|
})
|
||||||
|
|
||||||
it('calls the API', () => {
|
it('toasts an error message', () => {
|
||||||
expect(apolloMutateMock).toBeCalled()
|
expect(toastErrorMock).toBeCalledWith(
|
||||||
|
'Fehler beim senden des confirmation link an den Benutzer: OUCH!',
|
||||||
|
)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -42,13 +42,13 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.$toasted.global.success(
|
this.$toasted.success(
|
||||||
'Erfolgreich senden der Confirmation Link an die E-Mail des Users! ' + this.email,
|
'Erfolgreich senden der Confirmation Link an die E-Mail des Users! ' + this.email,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.$toasted.global.error(
|
this.$toasted.error(
|
||||||
'Fehler beim senden des confirmation link an den Benutzer' + error,
|
'Fehler beim senden des confirmation link an den Benutzer: ' + error.message,
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@ -52,7 +52,7 @@ const email = {
|
|||||||
EMAIL_LINK_VERIFICATION:
|
EMAIL_LINK_VERIFICATION:
|
||||||
process.env.EMAIL_LINK_VERIFICATION || 'http://localhost/vue/checkEmail/$1',
|
process.env.EMAIL_LINK_VERIFICATION || 'http://localhost/vue/checkEmail/$1',
|
||||||
EMAIL_LINK_SETPASSWORD: process.env.EMAIL_LINK_SETPASSWORD || 'http://localhost/vue/reset/$1',
|
EMAIL_LINK_SETPASSWORD: process.env.EMAIL_LINK_SETPASSWORD || 'http://localhost/vue/reset/$1',
|
||||||
RESEND_TIME: process.env.RESEND_TIME || 10,
|
RESEND_TIME: isNaN(parseInt(process.env.RESEND_TIME)) ? 10 : parseInt(process.env.RESEND_TIME),
|
||||||
}
|
}
|
||||||
|
|
||||||
const webhook = {
|
const webhook = {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user