mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
rename route for reset-password
This commit is contained in:
parent
33fc918429
commit
574c1cf203
@ -158,7 +158,7 @@ describe('ForgotPassword', () => {
|
||||
|
||||
describe('comingFrom login', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper(createMockObject('reset'))
|
||||
wrapper = Wrapper(createMockObject('resetPassword'))
|
||||
})
|
||||
|
||||
it('has another subtitle', () => {
|
||||
|
||||
@ -42,7 +42,7 @@ import { sendResetPasswordEmail } from '@/graphql/queries'
|
||||
import InputEmail from '@/components/Inputs/InputEmail'
|
||||
|
||||
const textFields = {
|
||||
reset: {
|
||||
resetPassword: {
|
||||
headline: 'settings.password.reset',
|
||||
subtitle: 'settings.password.resend_subtitle',
|
||||
button: 'settings.password.send_now',
|
||||
|
||||
@ -281,8 +281,8 @@ describe('Login', () => {
|
||||
await flushPromises()
|
||||
})
|
||||
|
||||
it('redirects to /reset/login', () => {
|
||||
expect(mockRouterPush).toBeCalledWith('/reset/login')
|
||||
it('redirects to /reset-password/login', () => {
|
||||
expect(mockRouterPush).toBeCalledWith('/reset-password/login')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -109,7 +109,7 @@ export default {
|
||||
if (error.message.includes('User email not validated')) {
|
||||
this.$router.push('/thx/login')
|
||||
} else if (error.message.includes('User has no password set yet')) {
|
||||
this.$router.push('/reset/login')
|
||||
this.$router.push('/reset-password/login')
|
||||
}
|
||||
loader.hide()
|
||||
})
|
||||
|
||||
@ -78,7 +78,7 @@ describe('ResetPassword', () => {
|
||||
describe('Register header', () => {
|
||||
describe('from reset', () => {
|
||||
beforeEach(() => {
|
||||
mocks.$route.path.mock = 'reset'
|
||||
mocks.$route.path.mock = 'reset-password'
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
@ -156,8 +156,8 @@ describe('ResetPassword', () => {
|
||||
expect(toastErrorSpy).toHaveBeenCalledWith('...Code is older than 10 minutes')
|
||||
})
|
||||
|
||||
it('router pushes to /forgot-password/reset', () => {
|
||||
expect(routerPushMock).toHaveBeenCalledWith('/forgot-password/reset')
|
||||
it('router pushes to /forgot-password/resetPassword', () => {
|
||||
expect(routerPushMock).toHaveBeenCalledWith('/forgot-password/resetPassword')
|
||||
})
|
||||
})
|
||||
|
||||
@ -204,9 +204,9 @@ describe('ResetPassword', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('server response with success on /reset', () => {
|
||||
describe('server response with success on /reset-password', () => {
|
||||
beforeEach(async () => {
|
||||
mocks.$route.path.mock = 'reset'
|
||||
mocks.$route.path.mock = 'reset-password'
|
||||
wrapper = Wrapper()
|
||||
apolloMutationMock.mockResolvedValue({
|
||||
data: {
|
||||
@ -219,8 +219,8 @@ describe('ResetPassword', () => {
|
||||
await flushPromises()
|
||||
})
|
||||
|
||||
it('redirects to "/thx/reset"', () => {
|
||||
expect(routerPushMock).toHaveBeenCalledWith('/thx/reset')
|
||||
it('redirects to "/thx/resetPassword"', () => {
|
||||
expect(routerPushMock).toHaveBeenCalledWith('/thx/resetPassword')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -95,20 +95,20 @@ export default {
|
||||
if (this.$route.path.includes('checkEmail')) {
|
||||
this.$router.push('/thx/checkEmail')
|
||||
} else {
|
||||
this.$router.push('/thx/reset')
|
||||
this.$router.push('/thx/resetPassword')
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.toastError(error.message)
|
||||
if (error.message.includes('Code is older than 10 minutes'))
|
||||
this.$router.push('/forgot-password/reset')
|
||||
this.$router.push('/forgot-password/resetPassword')
|
||||
})
|
||||
},
|
||||
setDisplaySetup() {
|
||||
if (this.$route.path.includes('checkEmail')) {
|
||||
this.displaySetup = textFields.checkEmail
|
||||
}
|
||||
if (this.$route.path.includes('reset')) {
|
||||
if (this.$route.path.includes('reset-password')) {
|
||||
this.displaySetup = textFields.reset
|
||||
}
|
||||
},
|
||||
|
||||
@ -53,9 +53,9 @@ describe('Thx', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('coming from /reset', () => {
|
||||
describe('coming from /reset-password', () => {
|
||||
beforeEach(() => {
|
||||
wrapper = Wrapper(createMockObject('reset'))
|
||||
wrapper = Wrapper(createMockObject('resetPassword'))
|
||||
})
|
||||
|
||||
it('renders the thanks text', () => {
|
||||
|
||||
@ -24,7 +24,7 @@ const textFields = {
|
||||
button: 'login',
|
||||
linkTo: '/login',
|
||||
},
|
||||
reset: {
|
||||
resetPassword: {
|
||||
headline: 'site.thx.title',
|
||||
subtitle: 'site.thx.reset',
|
||||
button: 'login',
|
||||
|
||||
@ -166,9 +166,11 @@ describe('router', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('reset', () => {
|
||||
describe('reset password', () => {
|
||||
it('loads the "ResetPassword" component', async () => {
|
||||
const component = await routes.find((r) => r.path === '/reset/:optin').component()
|
||||
const component = await routes
|
||||
.find((r) => r.path === '/reset-password/:optin')
|
||||
.component()
|
||||
expect(component.default.name).toBe('ResetPassword')
|
||||
})
|
||||
})
|
||||
|
||||
@ -75,7 +75,7 @@ const routes = [
|
||||
component: () => import('@/pages/SelectCommunity.vue'),
|
||||
},
|
||||
{
|
||||
path: '/reset/:optin',
|
||||
path: '/reset-password/:optin',
|
||||
component: () => import('@/pages/ResetPassword.vue'),
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user