move user settings in subfolder

This commit is contained in:
Moriz Wahl 2022-03-07 20:20:54 +01:00
parent 07dbce59dc
commit 9c246c62bd
13 changed files with 45 additions and 37 deletions

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import UserCardCoinAnimation from './UserCard_CoinAnimation'
import UserCoinAnimation from './UserCoinAnimation'
import { updateUserInfos } from '@/graphql/mutations'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
@ -28,7 +28,7 @@ describe('UserCard_CoinAnimation', () => {
}
const Wrapper = () => {
return mount(UserCardCoinAnimation, { localVue, mocks })
return mount(UserCoinAnimation, { localVue, mocks })
}
describe('mount', () => {

View File

@ -33,7 +33,7 @@
<script>
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserCoinAnimation',
name: 'UserCoinAnimation',
data() {
return {
CoinAnimationStatus: this.$store.state.coinanimation,

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import UserCardFormUserData from './UserCard_FormUserData'
import UserData from './UserData'
import flushPromises from 'flush-promises'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
@ -28,7 +28,7 @@ describe('UserCard_FormUserData', () => {
}
const Wrapper = () => {
return mount(UserCardFormUserData, { localVue, mocks })
return mount(UserData, { localVue, mocks })
}
describe('mount', () => {

View File

@ -67,7 +67,7 @@
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserData',
name: 'UserData',
data() {
return {
showUserData: true,

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import UserCardLanguage from './UserCard_Language'
import UserLanguage from './UserLanguage'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
@ -35,7 +35,7 @@ describe('UserCard_Language', () => {
}
const Wrapper = () => {
return mount(UserCardLanguage, { localVue, mocks })
return mount(UserLanguage, { localVue, mocks })
}
describe('mount', () => {

View File

@ -64,7 +64,7 @@ import LanguageSwitchSelect from '@/components/LanguageSwitchSelect.vue'
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserLanguage',
name: 'UserLanguage',
components: { LanguageSwitchSelect },
data() {
return {

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import UserCardNewsletter from './UserCard_Newsletter'
import UserNewsletter from './UserNewsletter'
import { unsubscribeNewsletter, subscribeNewsletter } from '@/graphql/mutations'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
@ -29,7 +29,7 @@ describe('UserCard_Newsletter', () => {
}
const Wrapper = () => {
return mount(UserCardNewsletter, { localVue, mocks })
return mount(UserNewsletter, { localVue, mocks })
}
describe('mount', () => {

View File

@ -30,7 +30,7 @@
import { subscribeNewsletter, unsubscribeNewsletter } from '@/graphql/mutations'
export default {
name: 'FormUserNewsletter',
name: 'UserNewsletter',
data() {
return {
newsletterState: this.$store.state.newsletterState,

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import UserCardFormPasswort from './UserCard_FormUserPasswort'
import UserPassword from './UserPassword'
import flushPromises from 'flush-promises'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
@ -20,7 +20,7 @@ describe('UserCard_FormUserPasswort', () => {
}
const Wrapper = () => {
return mount(UserCardFormPasswort, { localVue, mocks })
return mount(UserPassword, { localVue, mocks })
}
describe('mount', () => {

View File

@ -53,7 +53,7 @@ import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirma
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserPasswort',
name: 'UserPassword',
components: {
InputPassword,
InputPasswordConfirmation,

View File

@ -24,15 +24,23 @@ describe('Profile', () => {
})
it('has a user first and last name form', () => {
expect(wrapper.findComponent({ name: 'FormUserData' }).exists()).toBeTruthy()
})
it('has a user change password form', () => {
expect(wrapper.findComponent({ name: 'FormUserPasswort' }).exists()).toBeTruthy()
expect(wrapper.findComponent({ name: 'UserData' }).exists()).toBeTruthy()
})
it('has a user change language form', () => {
expect(wrapper.findComponent({ name: 'FormUserLanguage' }).exists()).toBeTruthy()
expect(wrapper.findComponent({ name: 'UserLanguage' }).exists()).toBeTruthy()
})
it('has a user change password form', () => {
expect(wrapper.findComponent({ name: 'UserPassword' }).exists()).toBeTruthy()
})
it('has a user change newsletter form', () => {
expect(wrapper.findComponent({ name: 'UserNewsletter' }).exists()).toBeTruthy()
})
it('has a user change coin animation form', () => {
expect(wrapper.findComponent({ name: 'UserCoinAnimation' }).exists()).toBeTruthy()
})
})
})

View File

@ -1,34 +1,34 @@
<template>
<div fluid="sm" class="mr-2">
<user-card :balance="balance" :transactionCount="transactionCount"></user-card>
<form-user-data />
<user-data />
<hr />
<form-user-passwort />
<user-password />
<hr />
<form-user-language />
<user-language />
<hr />
<form-user-newsletter />
<user-newsletter />
<hr />
<form-user-coin-animation />
<user-coin-animation />
</div>
</template>
<script>
import UserCard from '@/components/UserCard.vue'
import FormUserData from '@/components/UserCard_FormUserData.vue'
import FormUserPasswort from '@/components/UserCard_FormUserPasswort.vue'
import FormUserLanguage from '@/components/UserCard_Language.vue'
import FormUserNewsletter from '@/components/UserCard_Newsletter.vue'
import FormUserCoinAnimation from '@/components/UserCard_CoinAnimation.vue'
import UserData from '@/components/UserSettings/UserData.vue'
import UserPassword from '@/components/UserSettings/UserPassword.vue'
import UserLanguage from '@/components/UserSettings/UserLanguage.vue'
import UserNewsletter from '@/components/UserSettings/UserNewsletter.vue'
import UserCoinAnimation from '@/components/UserSettings/UserCoinAnimation.vue'
export default {
name: 'Profile',
components: {
UserCard,
FormUserData,
FormUserPasswort,
FormUserLanguage,
FormUserNewsletter,
FormUserCoinAnimation,
UserData,
UserPassword,
UserLanguage,
UserNewsletter,
UserCoinAnimation,
},
props: {
balance: { type: Number, default: 0 },

View File

@ -50,7 +50,7 @@ const routes = [
path: '/thx/:comingFrom',
component: () => import('@/pages/thx.vue'),
beforeEnter: (to, from, next) => {
const validFrom = ['forgot-password', 'reset', 'register', 'login', 'checkEmail']
const validFrom = ['forgot-password', 'reset-password', 'register', 'login', 'checkEmail']
if (!validFrom.includes(from.path.split('/')[1])) {
next({ path: '/login' })
} else {