diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 5127fc1cc..2ff182360 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -45,7 +45,6 @@ module.exports = { extensions: ['.js', '.vue'], // TODO: remove ignores ignores: [ - '/site.thx./', '/form./', '/time./', '/decay.types./', diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index a3e412a0e..f3385811b 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -245,11 +245,9 @@ "activateEmail": "Dein Konto wurde noch nicht aktiviert. Bitte überprüfe deine E-Mail und klicke den Aktivierungslink oder fordere einen neuen Aktivierungslink über die Password Reset Seite.", "checkEmail": "Deine E-Mail wurde erfolgreich verifiziert. Du kannst dich jetzt anmelden.", "email": "Wir haben dir eine E-Mail gesendet.", - "emailActivated": "Danke dass Du deine E-Mail bestätigt hast.", "errorTitle": "Achtung!", "register": "Du bist jetzt registriert, bitte überprüfe deine Emails und klicke auf den Aktivierungslink.", "reset": "Dein Passwort wurde geändert.", - "resetPassword": "Den Code den Du genutzt hast ist zu alt bitte fordere ein neuen über die Passwort Reset Seite an.", "title": "Danke!", "unsetPassword": "Dein Passwort wurde noch nicht gesetzt. Bitte setze es neu." } diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 4a7245147..f50d814f1 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -245,11 +245,9 @@ "activateEmail": "Your account has not been activated yet. Please check your emails and click the activation link or order a new activation link over the password reset page.", "checkEmail": "Your email has been successfully verified. You can sign in now.", "email": "We have sent you an email.", - "emailActivated": "Thank you your email has been activated.", "errorTitle": "Attention!", "register": "You are registered now, please check your emails and click the activation link.", "reset": "Your password has been changed.", - "resetPassword": "The code you used was to old please order a new on over the password reset page.", "title": "Thank you!", "unsetPassword": "Your password has not been set yet. Please set it again." } 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'),