diff --git a/frontend/src/routes/router.test.js b/frontend/src/routes/router.test.js index 8b6fbf3b9..5e2e16005 100644 --- a/frontend/src/routes/router.test.js +++ b/frontend/src/routes/router.test.js @@ -131,6 +131,20 @@ describe('router', () => { }) }) + describe('register-community', () => { + it('loads the "registerCommunity" component', async () => { + const component = await routes.find((r) => r.path === '/register-community').component() + expect(component.default.name).toBe('registerCommunity') + }) + }) + + describe('select-community', () => { + it('loads the "registerSelectCommunity" component', async () => { + const component = await routes.find((r) => r.path === '/select-community').component() + expect(component.default.name).toBe('registerSelectCommunity') + }) + }) + describe('reset', () => { it('loads the "ResetPassword" component', async () => { const component = await routes.find((r) => r.path === '/reset/:optin').component() diff --git a/frontend/src/routes/routes.js b/frontend/src/routes/routes.js index 6bd1ac75d..71315da9e 100755 --- a/frontend/src/routes/routes.js +++ b/frontend/src/routes/routes.js @@ -36,7 +36,7 @@ const routes = [ path: '/thx/:comingFrom', component: () => import('../views/Pages/thx.vue'), beforeEnter: (to, from, next) => { - const validFrom = ['password', 'reset', 'register', 'community'] + const validFrom = ['password', 'reset', 'register'] if (!validFrom.includes(from.path.split('/')[1])) { next({ path: '/login' }) } else { diff --git a/frontend/src/views/Pages/Register.vue b/frontend/src/views/Pages/Register.vue index 43885e1c6..8e1a5d26d 100755 --- a/frontend/src/views/Pages/Register.vue +++ b/frontend/src/views/Pages/Register.vue @@ -124,10 +124,11 @@
- - {{ $t('back') }} - - + + + {{ $t('back') }} + +
- - {{ $t('community.choose-another-community') }} - + + + {{ $t('community.choose-another-community') }} + +
diff --git a/frontend/src/views/Pages/RegisterCommunity.spec.js b/frontend/src/views/Pages/RegisterCommunity.spec.js index 88a60f349..102db5891 100644 --- a/frontend/src/views/Pages/RegisterCommunity.spec.js +++ b/frontend/src/views/Pages/RegisterCommunity.spec.js @@ -1,4 +1,4 @@ -import { mount } from '@vue/test-utils' +import { mount, RouterLinkStub } from '@vue/test-utils' import RegisterCommunity from './RegisterCommunity' const localVue = global.localVue @@ -23,8 +23,12 @@ describe('RegisterCommunity', () => { }, } + const stubs = { + RouterLink: RouterLinkStub, + } + const Wrapper = () => { - return mount(RegisterCommunity, { localVue, mocks }) + return mount(RegisterCommunity, { localVue, mocks, stubs }) } describe('mount', () => { diff --git a/frontend/src/views/Pages/RegisterCommunity.vue b/frontend/src/views/Pages/RegisterCommunity.vue index ca1305e87..9512edd1a 100644 --- a/frontend/src/views/Pages/RegisterCommunity.vue +++ b/frontend/src/views/Pages/RegisterCommunity.vue @@ -17,24 +17,30 @@ - - {{ $t('community.continue-to-registration') }} - + + + {{ $t('community.continue-to-registration') }} + +
- - {{ $t('community.choose-another-community') }} - + + + {{ $t('community.choose-another-community') }} + +
- {{ $t('back') }} + + {{ $t('back') }} +
@@ -44,7 +50,7 @@