+
+
+
+
diff --git a/frontend/src/pages/thx.spec.js b/frontend/src/pages/thx.spec.js
deleted file mode 100644
index a9d5ba3b7..000000000
--- a/frontend/src/pages/thx.spec.js
+++ /dev/null
@@ -1,101 +0,0 @@
-import { mount } from '@vue/test-utils'
-import Thx from './thx'
-
-const localVue = global.localVue
-
-const createMockObject = (comingFrom) => {
- return {
- $t: jest.fn((t) => t),
- $route: {
- params: {
- comingFrom,
- },
- },
- }
-}
-
-describe('Thx', () => {
- let wrapper
-
- const Wrapper = (mocks) => {
- return mount(Thx, { localVue, mocks })
- }
-
- describe('mount', () => {
- beforeEach(() => {
- wrapper = Wrapper(createMockObject('forgotPassword'))
- })
-
- it('renders the thx page', () => {
- expect(wrapper.find('div.header').exists()).toBeTruthy()
- })
-
- it('renders the title', () => {
- expect(wrapper.find('p.h1').text()).toBe('site.thx.title')
- })
- })
-
- describe('coming from /forgot-password', () => {
- beforeEach(() => {
- wrapper = Wrapper(createMockObject('forgotPassword'))
- })
-
- it('renders the thanks text', () => {
- expect(wrapper.find('p.h4').text()).toBe('site.thx.email')
- })
-
- it('renders the thanks redirect button', () => {
- expect(wrapper.find('a.btn').text()).toBe('login')
- })
-
- it('links the redirect button to /login', () => {
- expect(wrapper.find('a.btn').attributes('href')).toBe('/login')
- })
- })
-
- describe('coming from /reset-password', () => {
- beforeEach(() => {
- wrapper = Wrapper(createMockObject('resetPassword'))
- })
-
- it('renders the thanks text', () => {
- expect(wrapper.find('p.h4').text()).toBe('site.thx.reset')
- })
-
- it('renders the thanks redirect button', () => {
- expect(wrapper.find('a.btn').text()).toBe('login')
- })
-
- it('links the redirect button to /login', () => {
- expect(wrapper.find('a.btn').attributes('href')).toBe('/login')
- })
- })
-
- describe('coming from /register', () => {
- beforeEach(() => {
- wrapper = Wrapper(createMockObject('register'))
- })
-
- it('renders the thanks text', () => {
- expect(wrapper.find('p.h4').text()).toBe('site.thx.register')
- })
- })
-
- describe('coming from /login', () => {
- beforeEach(() => {
- wrapper = Wrapper(createMockObject('login'))
- })
-
- it('renders the thanks text', () => {
- expect(wrapper.find('p.h4').text()).toBe('site.thx.activateEmail')
- })
-
- it('renders the thanks redirect button', () => {
- expect(wrapper.find('a.btn').text()).toBe('settings.password.reset')
- })
-
- it('links the redirect button to /forgot-password', () => {
- expect(wrapper.find('a.btn').attributes('href')).toBe('/forgot-password')
- })
- })
-})
diff --git a/frontend/src/pages/thx.vue b/frontend/src/pages/thx.vue
deleted file mode 100644
index 7e203e8aa..000000000
--- a/frontend/src/pages/thx.vue
+++ /dev/null
@@ -1,76 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/frontend/src/routes/router.test.js b/frontend/src/routes/router.test.js
index 925b3ffca..32ab90d4e 100644
--- a/frontend/src/routes/router.test.js
+++ b/frontend/src/routes/router.test.js
@@ -49,8 +49,8 @@ describe('router', () => {
expect(routes.find((r) => r.path === '/').redirect()).toEqual({ path: '/login' })
})
- it('has seventeen routes defined', () => {
- expect(routes).toHaveLength(17)
+ it('has sixteen routes defined', () => {
+ expect(routes).toHaveLength(16)
})
describe('overview', () => {
@@ -111,31 +111,6 @@ describe('router', () => {
})
})
- describe('thx', () => {
- const thx = routes.find((r) => r.path === '/thx/:comingFrom/:code?')
-
- it('loads the "Thx" page', async () => {
- const component = await thx.component()
- expect(component.default.name).toBe('Thx')
- })
-
- describe('beforeEnter', () => {
- const beforeEnter = thx.beforeEnter
- const next = jest.fn()
-
- it('redirects to login when not coming from a valid page', () => {
- beforeEnter({}, { path: '' }, next)
- expect(next).toBeCalledWith({ path: '/login' })
- })
-
- it('enters the page when coming from a valid page', () => {
- jest.resetAllMocks()
- beforeEnter({}, { path: '/forgot-password' }, next)
- expect(next).toBeCalledWith()
- })
- })
- })
-
describe('forgot password', () => {
it('loads the "ForgotPassword" page', async () => {
const component = await routes.find((r) => r.path === '/forgot-password').component()
diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js
index a6586c201..e68f97502 100755
--- a/frontend/src/routes/routes.js
+++ b/frontend/src/routes/routes.js
@@ -46,18 +46,6 @@ const routes = [
path: '/register/:code?',
component: () => import('@/pages/Register.vue'),
},
- {
- path: '/thx/:comingFrom/:code?',
- component: () => import('@/pages/thx.vue'),
- beforeEnter: (to, from, next) => {
- const validFrom = ['forgot-password', 'reset-password', 'register', 'login', 'checkEmail']
- if (!validFrom.includes(from.path.split('/')[1])) {
- next({ path: '/login' })
- } else {
- next()
- }
- },
- },
{
path: '/forgot-password',
component: () => import('@/pages/ForgotPassword.vue'),