merge master, resolve conflicts

This commit is contained in:
ogerly 2022-03-09 08:20:51 +01:00
commit 59bff37ba4
104 changed files with 382 additions and 371 deletions

View File

@ -6,6 +6,11 @@ module.exports = {
collectCoverageFrom: ['src/**/*.ts', '!**/node_modules/**'],
setupFiles: ['<rootDir>/test/testSetup.ts'],
moduleNameMapper: {
'@/(.*)': '<rootDir>/src/$1',
'@model/(.*)': '<rootDir>/src/graphql/model/$1',
'@arg/(.*)': '<rootDir>/src/graphql/arg/$1',
'@enum/(.*)': '<rootDir>/src/graphql/enum/$1',
'@repository/(.*)': '<rootDir>/src/typeorm/repository/$1',
'@entity/(.*)':
process.env.NODE_ENV === 'development'
? '<rootDir>/../database/entity/$1'

View File

@ -60,7 +60,12 @@
"typescript": "^4.3.4"
},
"_moduleAliases": {
"@": "./src",
"@arg": "./src/graphql/arg",
"@dbTools": "../database/build/src",
"@entity": "../database/build/entity",
"@dbTools": "../database/build/src"
"@enum": "./src/graphql/enum",
"@model": "./src/graphql/model",
"@repository": "./src/typeorm/repository"
}
}

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { KlicktippConnector } from './klicktippConnector'
import CONFIG from '../config'
import CONFIG from '@/config'
const klicktippConnector = new KlicktippConnector()

View File

@ -1,5 +1,5 @@
import jwt from 'jsonwebtoken'
import CONFIG from '../config/'
import CONFIG from '@/config/'
import { CustomJwtPayload } from './CustomJwtPayload'
export const decode = (token: string): CustomJwtPayload | null => {

View File

@ -65,7 +65,8 @@ const email = {
EMAIL_SMTP_PORT: process.env.EMAIL_SMTP_PORT || '587',
EMAIL_LINK_VERIFICATION:
process.env.EMAIL_LINK_VERIFICATION || 'http://localhost/checkEmail/{code}',
EMAIL_LINK_SETPASSWORD: process.env.EMAIL_LINK_SETPASSWORD || 'http://localhost/reset/{code}',
EMAIL_LINK_SETPASSWORD:
process.env.EMAIL_LINK_SETPASSWORD || 'http://localhost/reset-password/{code}',
RESEND_TIME: isNaN(resendTime) ? 10 : resendTime,
}

View File

@ -1,5 +1,5 @@
import { ArgsType, Field, Int } from 'type-graphql'
import { Order } from '../enum/Order'
import { Order } from '@enum/Order'
@ArgsType()
export default class Paginated {

View File

@ -2,12 +2,12 @@
import { AuthChecker } from 'type-graphql'
import { decode, encode } from '../../auth/JWT'
import { ROLE_UNAUTHORIZED, ROLE_USER, ROLE_ADMIN } from '../../auth/ROLES'
import { RIGHTS } from '../../auth/RIGHTS'
import { decode, encode } from '@/auth/JWT'
import { ROLE_UNAUTHORIZED, ROLE_USER, ROLE_ADMIN } from '@/auth/ROLES'
import { RIGHTS } from '@/auth/RIGHTS'
import { getCustomRepository } from '@dbTools/typeorm'
import { UserRepository } from '../../typeorm/repository/User'
import { INALIENABLE_RIGHTS } from '../../auth/INALIENABLE_RIGHTS'
import { UserRepository } from '@repository/User'
import { INALIENABLE_RIGHTS } from '@/auth/INALIENABLE_RIGHTS'
import { ServerUser } from '@entity/ServerUser'
const isAuthorized: AuthChecker<any> = async ({ context }, rights) => {

View File

@ -1,7 +1,7 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { ObjectType, Field } from 'type-graphql'
import { GdtEntryType } from '../enum/GdtEntryType'
import { GdtEntryType } from '@enum/GdtEntryType'
@ObjectType()
export class GdtEntry {

View File

@ -1,19 +0,0 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
/*
import { ObjectType, Field } from 'type-graphql'
@ObjectType()
export class GdtSumPerEmail {
constructor(email: string, summe: number) {
this.email = email
this.summe = summe
}
@Field(() => String)
email: string
@Field(() => Number)
summe: number
}
*/

View File

@ -2,7 +2,7 @@ import { ObjectType, Field } from 'type-graphql'
import { Decay } from './Decay'
import { Transaction as dbTransaction } from '@entity/Transaction'
import Decimal from 'decimal.js-light'
import { TransactionTypeId } from '../enum/TransactionTypeId'
import { TransactionTypeId } from '@enum/TransactionTypeId'
import { User } from './User'
@ObjectType()

View File

@ -1,5 +1,5 @@
import { ObjectType, Field } from 'type-graphql'
import CONFIG from '../../config'
import CONFIG from '@/config'
import Decimal from 'decimal.js-light'
import { Transaction } from './Transaction'

View File

@ -10,25 +10,25 @@ import {
getConnection,
In,
} from '@dbTools/typeorm'
import { UserAdmin, SearchUsersResult } from '../model/UserAdmin'
import { PendingCreation } from '../model/PendingCreation'
import { CreatePendingCreations } from '../model/CreatePendingCreations'
import { UpdatePendingCreation } from '../model/UpdatePendingCreation'
import { RIGHTS } from '../../auth/RIGHTS'
import { UserRepository } from '../../typeorm/repository/User'
import CreatePendingCreationArgs from '../arg/CreatePendingCreationArgs'
import UpdatePendingCreationArgs from '../arg/UpdatePendingCreationArgs'
import SearchUsersArgs from '../arg/SearchUsersArgs'
import { UserAdmin, SearchUsersResult } from '@model/UserAdmin'
import { PendingCreation } from '@model/PendingCreation'
import { CreatePendingCreations } from '@model/CreatePendingCreations'
import { UpdatePendingCreation } from '@model/UpdatePendingCreation'
import { RIGHTS } from '@/auth/RIGHTS'
import { UserRepository } from '@repository/User'
import CreatePendingCreationArgs from '@arg/CreatePendingCreationArgs'
import UpdatePendingCreationArgs from '@arg/UpdatePendingCreationArgs'
import SearchUsersArgs from '@arg/SearchUsersArgs'
import { Transaction } from '@entity/Transaction'
import { TransactionRepository } from '../../typeorm/repository/Transaction'
import { calculateDecay } from '../../util/decay'
import { TransactionRepository } from '@repository/Transaction'
import { calculateDecay } from '@/util/decay'
import { AdminPendingCreation } from '@entity/AdminPendingCreation'
import { hasElopageBuys } from '../../util/hasElopageBuys'
import { hasElopageBuys } from '@/util/hasElopageBuys'
import { LoginEmailOptIn } from '@entity/LoginEmailOptIn'
import { User } from '@entity/User'
import { TransactionTypeId } from '../enum/TransactionTypeId'
import { TransactionTypeId } from '@enum/TransactionTypeId'
import Decimal from 'decimal.js-light'
import { Decay } from '../model/Decay'
import { Decay } from '@model/Decay'
// const EMAIL_OPT_IN_REGISTER = 1
// const EMAIL_OPT_UNKNOWN = 3 // elopage?

View File

@ -3,10 +3,10 @@
import { Resolver, Query, Ctx, Authorized } from 'type-graphql'
import { getCustomRepository } from '@dbTools/typeorm'
import { Balance } from '../model/Balance'
import { UserRepository } from '../../typeorm/repository/User'
import { calculateDecay } from '../../util/decay'
import { RIGHTS } from '../../auth/RIGHTS'
import { Balance } from '@model/Balance'
import { UserRepository } from '@repository/User'
import { calculateDecay } from '@/util/decay'
import { RIGHTS } from '@/auth/RIGHTS'
import { Transaction } from '@entity/Transaction'
import Decimal from 'decimal.js-light'

View File

@ -2,10 +2,10 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { createTestClient } from 'apollo-server-testing'
import createServer from '../../server/createServer'
import CONFIG from '../../config'
import createServer from '@/server/createServer'
import CONFIG from '@/config'
jest.mock('../../config')
jest.mock('@/config')
let query: any

View File

@ -2,9 +2,9 @@
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { Resolver, Query, Authorized } from 'type-graphql'
import { RIGHTS } from '../../auth/RIGHTS'
import CONFIG from '../../config'
import { Community } from '../model/Community'
import { RIGHTS } from '@/auth/RIGHTS'
import CONFIG from '@/config'
import { Community } from '@model/Community'
@Resolver()
export class CommunityResolver {

View File

@ -3,13 +3,13 @@
import { Resolver, Query, Args, Ctx, Authorized, Arg } from 'type-graphql'
import { getCustomRepository } from '@dbTools/typeorm'
import CONFIG from '../../config'
import { GdtEntryList } from '../model/GdtEntryList'
import Paginated from '../arg/Paginated'
import { apiGet } from '../../apis/HttpRequest'
import { UserRepository } from '../../typeorm/repository/User'
import { Order } from '../enum/Order'
import { RIGHTS } from '../../auth/RIGHTS'
import CONFIG from '@/config'
import { GdtEntryList } from '@model/GdtEntryList'
import Paginated from '@arg/Paginated'
import { apiGet } from '@/apis/HttpRequest'
import { UserRepository } from '@repository/User'
import { Order } from '@enum/Order'
import { RIGHTS } from '@/auth/RIGHTS'
@Resolver()
export class GdtResolver {

View File

@ -7,9 +7,9 @@ import {
getKlicktippTagMap,
unsubscribe,
klicktippSignIn,
} from '../../apis/KlicktippController'
import { RIGHTS } from '../../auth/RIGHTS'
import SubscribeNewsletterArgs from '../arg/SubscribeNewsletterArgs'
} from '@/apis/KlicktippController'
import { RIGHTS } from '@/auth/RIGHTS'
import SubscribeNewsletterArgs from '@arg/SubscribeNewsletterArgs'
@Resolver()
export class KlicktippResolver {

View File

@ -6,32 +6,32 @@
import { Resolver, Query, Args, Authorized, Ctx, Mutation } from 'type-graphql'
import { getCustomRepository, getConnection } from '@dbTools/typeorm'
import CONFIG from '../../config'
import { sendTransactionReceivedEmail } from '../../mailer/sendTransactionReceivedEmail'
import CONFIG from '@/config'
import { sendTransactionReceivedEmail } from '@/mailer/sendTransactionReceivedEmail'
import { Transaction } from '../model/Transaction'
import { TransactionList } from '../model/TransactionList'
import { Transaction } from '@model/Transaction'
import { TransactionList } from '@model/TransactionList'
import TransactionSendArgs from '../arg/TransactionSendArgs'
import Paginated from '../arg/Paginated'
import TransactionSendArgs from '@arg/TransactionSendArgs'
import Paginated from '@arg/Paginated'
import { Order } from '../enum/Order'
import { Order } from '@enum/Order'
import { UserRepository } from '../../typeorm/repository/User'
import { TransactionRepository } from '../../typeorm/repository/Transaction'
import { UserRepository } from '@repository/User'
import { TransactionRepository } from '@repository/Transaction'
import { User as dbUser } from '@entity/User'
import { Transaction as dbTransaction } from '@entity/Transaction'
import { apiPost } from '../../apis/HttpRequest'
import { TransactionTypeId } from '../enum/TransactionTypeId'
import { calculateBalance, isHexPublicKey } from '../../util/validate'
import { RIGHTS } from '../../auth/RIGHTS'
import { User } from '../model/User'
import { communityUser } from '../../util/communityUser'
import { virtualDecayTransaction } from '../../util/virtualDecayTransaction'
import { apiPost } from '@/apis/HttpRequest'
import { TransactionTypeId } from '@enum/TransactionTypeId'
import { calculateBalance, isHexPublicKey } from '@/util/validate'
import { RIGHTS } from '@/auth/RIGHTS'
import { User } from '@model/User'
import { communityUser } from '@/util/communityUser'
import { virtualDecayTransaction } from '@/util/virtualDecayTransaction'
import Decimal from 'decimal.js-light'
import { calculateDecay } from '../../util/decay'
import { calculateDecay } from '@/util/decay'
@Resolver()
export class TransactionResolver {

View File

@ -4,17 +4,17 @@
import { createTestClient } from 'apollo-server-testing'
import gql from 'graphql-tag'
import { GraphQLError } from 'graphql'
import createServer from '../../server/createServer'
import createServer from '@/server/createServer'
import { resetDB, initialize } from '@dbTools/helpers'
import { LoginEmailOptIn } from '@entity/LoginEmailOptIn'
import { User } from '@entity/User'
import CONFIG from '../../config'
import { sendAccountActivationEmail } from '../../mailer/sendAccountActivationEmail'
// import { klicktippSignIn } from '../../apis/KlicktippController'
import CONFIG from '@/config'
import { sendAccountActivationEmail } from '@/mailer/sendAccountActivationEmail'
// import { klicktippSignIn } from '@/apis/KlicktippController'
jest.setTimeout(10000)
jest.mock('../../mailer/sendAccountActivationEmail', () => {
jest.mock('@/mailer/sendAccountActivationEmail', () => {
return {
__esModule: true,
sendAccountActivationEmail: jest.fn(),
@ -22,7 +22,7 @@ jest.mock('../../mailer/sendAccountActivationEmail', () => {
})
/*
jest.mock('../../apis/KlicktippController', () => {
jest.mock('@/apis/KlicktippController', () => {
return {
__esModule: true,
klicktippSignIn: jest.fn(),

View File

@ -4,24 +4,24 @@
import fs from 'fs'
import { Resolver, Query, Args, Arg, Authorized, Ctx, UseMiddleware, Mutation } from 'type-graphql'
import { getConnection, getCustomRepository, QueryRunner } from '@dbTools/typeorm'
import CONFIG from '../../config'
import { User } from '../model/User'
import CONFIG from '@/config'
import { User } from '@model/User'
import { User as DbUser } from '@entity/User'
import { encode } from '../../auth/JWT'
import CreateUserArgs from '../arg/CreateUserArgs'
import UnsecureLoginArgs from '../arg/UnsecureLoginArgs'
import UpdateUserInfosArgs from '../arg/UpdateUserInfosArgs'
import { klicktippNewsletterStateMiddleware } from '../../middleware/klicktippMiddleware'
import { UserSettingRepository } from '../../typeorm/repository/UserSettingRepository'
import { Setting } from '../enum/Setting'
import { UserRepository } from '../../typeorm/repository/User'
import { encode } from '@/auth/JWT'
import CreateUserArgs from '@arg/CreateUserArgs'
import UnsecureLoginArgs from '@arg/UnsecureLoginArgs'
import UpdateUserInfosArgs from '@arg/UpdateUserInfosArgs'
import { klicktippNewsletterStateMiddleware } from '@/middleware/klicktippMiddleware'
import { UserSettingRepository } from '@repository/UserSettingRepository'
import { Setting } from '@enum/Setting'
import { UserRepository } from '@repository/User'
import { LoginEmailOptIn } from '@entity/LoginEmailOptIn'
import { sendResetPasswordEmail } from '../../mailer/sendResetPasswordEmail'
import { sendAccountActivationEmail } from '../../mailer/sendAccountActivationEmail'
import { klicktippSignIn } from '../../apis/KlicktippController'
import { RIGHTS } from '../../auth/RIGHTS'
import { ROLE_ADMIN } from '../../auth/ROLES'
import { hasElopageBuys } from '../../util/hasElopageBuys'
import { sendResetPasswordEmail } from '@/mailer/sendResetPasswordEmail'
import { sendAccountActivationEmail } from '@/mailer/sendAccountActivationEmail'
import { klicktippSignIn } from '@/apis/KlicktippController'
import { RIGHTS } from '@/auth/RIGHTS'
import { ROLE_ADMIN } from '@/auth/ROLES'
import { hasElopageBuys } from '@/util/hasElopageBuys'
import { ServerUser } from '@entity/ServerUser'
const EMAIL_OPT_IN_RESET_PASSWORD = 2

View File

@ -1,6 +1,6 @@
import { sendEMail } from './sendEMail'
import { createTransport } from 'nodemailer'
import CONFIG from '../config'
import CONFIG from '@/config'
CONFIG.EMAIL = false
CONFIG.EMAIL_SMTP_URL = 'EMAIL_SMTP_URL'

View File

@ -1,6 +1,6 @@
import { createTransport } from 'nodemailer'
import CONFIG from '../config'
import CONFIG from '@/config'
export const sendEMail = async (emailDef: {
to: string

View File

@ -1,7 +1,7 @@
import { MiddlewareFn } from 'type-graphql'
import { /* klicktippSignIn, */ getKlickTippUser } from '../apis/KlicktippController'
import { KlickTipp } from '../graphql/model/KlickTipp'
import CONFIG from '../config/index'
import { /* klicktippSignIn, */ getKlickTippUser } from '@/apis/KlicktippController'
import { KlickTipp } from '@model/KlickTipp'
import CONFIG from '@/config'
// export const klicktippRegistrationMiddleware: MiddlewareFn = async (
// // Only for demo

View File

@ -5,8 +5,8 @@ import { ApolloServer } from 'apollo-server-express'
import express, { Express } from 'express'
// database
import connection from '../typeorm/connection'
import { checkDBVersion } from '../typeorm/DBVersion'
import connection from '@/typeorm/connection'
import { checkDBVersion } from '@/typeorm/DBVersion'
// server
import cors from './cors'
@ -14,13 +14,13 @@ import serverContext from './context'
import plugins from './plugins'
// config
import CONFIG from '../config'
import CONFIG from '@/config'
// graphql
import schema from '../graphql/schema'
import schema from '@/graphql/schema'
// webhooks
import { elopageWebhook } from '../webhook/elopage'
import { elopageWebhook } from '@/webhook/elopage'
import { Connection } from '@dbTools/typeorm'
// TODO implement

View File

@ -1,7 +1,7 @@
// TODO This is super weird - since the entities are defined in another project they have their own globals.
// We cannot use our connection here, but must use the external typeorm installation
import { Connection, createConnection, FileLogger } from '@dbTools/typeorm'
import CONFIG from '../config'
import CONFIG from '@/config'
import { entities } from '@entity/index'
const connection = async (): Promise<Connection | null> => {

View File

@ -1,7 +1,7 @@
import { EntityRepository, Repository } from '@dbTools/typeorm'
import { Transaction } from '@entity/Transaction'
import { Order } from '../../graphql/enum/Order'
import { TransactionTypeId } from '../../graphql/enum/TransactionTypeId'
import { Order } from '@enum/Order'
import { TransactionTypeId } from '@enum/TransactionTypeId'
@EntityRepository(Transaction)
export class TransactionRepository extends Repository<Transaction> {

View File

@ -1,7 +1,7 @@
import { EntityRepository, Repository } from '@dbTools/typeorm'
import { UserSetting } from '@entity/UserSetting'
import { Setting } from '../../graphql/enum/Setting'
import { isStringBoolean } from '../../util/validate'
import { Setting } from '@enum/Setting'
import { isStringBoolean } from '@/util/validate'
@EntityRepository(UserSetting)
export class UserSettingRepository extends Repository<UserSetting> {

View File

@ -2,7 +2,7 @@
import { SaveOptions, RemoveOptions } from '@dbTools/typeorm'
import { User as dbUser } from '@entity/User'
import { User } from '../graphql/model/User'
import { User } from '@model/User'
const communityDbUser: dbUser = {
id: -1,

View File

@ -1,6 +1,6 @@
import Decimal from 'decimal.js-light'
import CONFIG from '../config'
import { Decay } from '../graphql/model/Decay'
import CONFIG from '@/config'
import { Decay } from '@model/Decay'
// TODO: externalize all those definitions and functions into an external decay library

View File

@ -1,7 +1,7 @@
import { calculateDecay } from './decay'
import Decimal from 'decimal.js-light'
import { Transaction } from '@entity/Transaction'
import { Decay } from '../graphql/model/Decay'
import { Decay } from '@model/Decay'
function isStringBoolean(value: string): boolean {
const lowerValue = value.toLowerCase()

View File

@ -3,9 +3,9 @@ import Decimal from 'decimal.js-light'
import { SaveOptions, RemoveOptions } from '@dbTools/typeorm'
import { Transaction as dbTransaction } from '@entity/Transaction'
import { calculateDecay } from './decay'
import { TransactionTypeId } from '../graphql/enum/TransactionTypeId'
import { Transaction } from '../graphql/model/Transaction'
import { User } from '../graphql/model/User'
import { TransactionTypeId } from '@enum/TransactionTypeId'
import { Transaction } from '@model/Transaction'
import { User } from '@model/User'
const virtualDecayTransaction = (
balance: Decimal,

View File

@ -28,7 +28,7 @@
*/
import { LoginElopageBuys } from '@entity/LoginElopageBuys'
import { UserResolver } from '../graphql/resolver/UserResolver'
import { UserResolver } from '@/graphql/resolver/UserResolver'
import { User as dbUser } from '@entity/User'
export const elopageWebhook = async (req: any, res: any): Promise<void> => {

View File

@ -47,8 +47,13 @@
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
"paths": { /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
"@/*": ["./src/*"],
"@arg/*": ["./src/graphql/arg/*"],
"@dbTools/*": ["../database/src/*"],
"@entity/*": ["../database/entity/*"],
"@dbTools/*": ["../database/src/*"]
"@enum/*": ["./src/graphql/enum/*"],
"@model/*": ["./src/graphql/model/*"],
"@repository/*": ["./src/typeorm/repository/*"]
},
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
// "typeRoots": [], /* List of folders to include type definitions from. */

View File

@ -12,6 +12,7 @@ module.exports = {
'\\.(css|less)$': 'identity-obj-proxy',
'\\.(scss)$': '<rootDir>/src/assets/mocks/styleMock.js',
'^@/(.*)$': '<rootDir>/src/$1',
'^@test/(.*)$': '<rootDir>/test/$1',
},
transform: {
'^.+\\.vue$': 'vue-jest',

View File

@ -10,8 +10,8 @@
<script>
import { ParticlesBg } from 'particles-bg-vue'
import icon from './icon.js'
import DashboardLayout from '@/views/Layout/DashboardLayout_gdd.vue'
import AuthLayoutGDD from '@/views/Layout/AuthLayout_gdd.vue'
import DashboardLayout from '@/layouts/DashboardLayout_gdd.vue'
import AuthLayoutGDD from '@/layouts/AuthLayout_gdd.vue'
export default {
name: 'app',

View File

@ -57,12 +57,12 @@
</template>
<script>
import TransactionListItem from '../../../components/TransactionListItem'
import PaginationButtons from '../../../components/PaginationButtons'
import TransactionDecay from '../../../components/Transactions/TransactionDecay'
import TransactionSend from '../../../components/Transactions/TransactionSend'
import TransactionReceive from '../../../components/Transactions/TransactionReceive'
import TransactionCreation from '../../../components/Transactions/TransactionCreation'
import TransactionListItem from '@/components/TransactionListItem'
import PaginationButtons from '@/components/PaginationButtons'
import TransactionDecay from '@/components/Transactions/TransactionDecay'
import TransactionSend from '@/components/Transactions/TransactionSend'
import TransactionReceive from '@/components/Transactions/TransactionReceive'
import TransactionCreation from '@/components/Transactions/TransactionCreation'
export default {
name: 'gdd-transaction-list',

View File

@ -1,8 +1,8 @@
import { mount } from '@vue/test-utils'
import { GdtEntryType } from '../../../graphql/enums'
import { GdtEntryType } from '@/graphql/enums'
import GdtTransactionList from './GdtTransactionList'
import { toastErrorSpy } from '../../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
const localVue = global.localVue

View File

@ -36,9 +36,9 @@
</template>
<script>
import { listGDTEntriesQuery } from '../../../graphql/queries'
import PaginationButtons from '../../../components/PaginationButtons'
import Transaction from '../../../components/Transaction.vue'
import { listGDTEntriesQuery } from '@/graphql/queries'
import PaginationButtons from '@/components/PaginationButtons'
import Transaction from '@/components/Transaction.vue'
export default {
name: 'gdt-transaction-list',

View File

@ -4,7 +4,7 @@ import InputPasswordConfirmation from './InputPasswordConfirmation'
const localVue = global.localVue
// validation is tested in src/views/Pages/UserProfile/UserCard_FormUserPasswort.spec.js
// validation is tested in src/components/UserSettings/UserPassword.spec.js
describe('InputPasswordConfirmation', () => {
let wrapper

View File

@ -12,8 +12,8 @@
</div>
</template>
<script>
import locales from '../locales/'
import { updateUserInfos } from '../graphql/mutations'
import locales from '@/locales/'
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'LanguageSwitch',

View File

@ -32,7 +32,7 @@
</b-card>
</template>
<script>
import { updateUserInfos } from '../../../graphql/mutations'
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserMail',

View File

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

View File

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

View File

@ -1,8 +1,8 @@
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'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
const localVue = global.localVue
@ -28,7 +28,7 @@ describe('UserCard_FormUserData', () => {
}
const Wrapper = () => {
return mount(UserCardFormUserData, { localVue, mocks })
return mount(UserData, { localVue, mocks })
}
describe('mount', () => {

View File

@ -64,10 +64,10 @@
</b-card>
</template>
<script>
import { updateUserInfos } from '../../../graphql/mutations'
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserData',
name: 'UserData',
data() {
return {
showUserData: true,

View File

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

View File

@ -60,11 +60,11 @@
</b-card>
</template>
<script>
import LanguageSwitchSelect from '../../../components/LanguageSwitchSelect.vue'
import { updateUserInfos } from '../../../graphql/mutations'
import LanguageSwitchSelect from '@/components/LanguageSwitchSelect.vue'
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserLanguage',
name: 'UserLanguage',
components: { LanguageSwitchSelect },
data() {
return {

View File

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

View File

@ -27,10 +27,10 @@
</b-card>
</template>
<script>
import { subscribeNewsletter, unsubscribeNewsletter } from '../../../graphql/mutations'
import { subscribeNewsletter, unsubscribeNewsletter } from '@/graphql/mutations'
export default {
name: 'FormUserNewsletter',
name: 'UserNewsletter',
data() {
return {
newsletterState: this.$store.state.newsletterState,

View File

@ -1,8 +1,8 @@
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'
import { toastErrorSpy, toastSuccessSpy } from '@test/testSetup'
const localVue = global.localVue
@ -20,7 +20,7 @@ describe('UserCard_FormUserPasswort', () => {
}
const Wrapper = () => {
return mount(UserCardFormPasswort, { localVue, mocks })
return mount(UserPassword, { localVue, mocks })
}
describe('mount', () => {

View File

@ -48,12 +48,12 @@
</b-card>
</template>
<script>
import InputPassword from '../../../components/Inputs/InputPassword'
import InputPasswordConfirmation from '../../../components/Inputs/InputPasswordConfirmation'
import { updateUserInfos } from '../../../graphql/mutations'
import InputPassword from '@/components/Inputs/InputPassword'
import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirmation'
import { updateUserInfos } from '@/graphql/mutations'
export default {
name: 'FormUserPasswort',
name: 'UserPassword',
components: {
InputPassword,
InputPasswordConfirmation,

View File

@ -59,7 +59,7 @@
</footer>
</template>
<script>
import CONFIG from '../../config'
import CONFIG from '@/config'
export default {
data() {

View File

@ -2,7 +2,7 @@ import { mount, RouterLinkStub } from '@vue/test-utils'
import flushPromises from 'flush-promises'
import DashboardLayoutGdd from './DashboardLayout_gdd'
import { toastErrorSpy } from '../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
jest.useFakeTimers()

View File

@ -37,12 +37,12 @@
</div>
</template>
<script>
import Navbar from '../../components/Menu/Navbar.vue'
import Sidebar from '../../components/Menu/Sidebar.vue'
import { logout, transactionsQuery } from '../../graphql/queries'
import Navbar from '@/components/Menu/Navbar.vue'
import Sidebar from '@/components/Menu/Sidebar.vue'
import { logout, transactionsQuery } from '@/graphql/queries'
import ContentFooter from './ContentFooter.vue'
import { FadeTransition } from 'vue2-transitions'
import CONFIG from '../../config'
import CONFIG from '@/config'
export default {
components: {

View File

@ -116,7 +116,7 @@ describe('ForgotPassword', () => {
await flushPromises()
})
it('pushes to "/thx/password"', () => {
it('pushes to "/thx/forgotPassword"', () => {
expect(mockAPIcall).toBeCalledWith(
expect.objectContaining({
variables: {
@ -124,7 +124,7 @@ describe('ForgotPassword', () => {
},
}),
)
expect(mockRouterPush).toHaveBeenCalledWith('/thx/password')
expect(mockRouterPush).toHaveBeenCalledWith('/thx/forgotPassword')
})
})
@ -141,7 +141,7 @@ describe('ForgotPassword', () => {
await flushPromises()
})
it('pushes to "/thx/password"', () => {
it('pushes to "/thx/forgotPassword"', () => {
expect(mockAPIcall).toBeCalledWith(
expect.objectContaining({
variables: {
@ -149,7 +149,7 @@ describe('ForgotPassword', () => {
},
}),
)
expect(mockRouterPush).toHaveBeenCalledWith('/thx/password')
expect(mockRouterPush).toHaveBeenCalledWith('/thx/forgotPassword')
})
})
})
@ -158,7 +158,7 @@ describe('ForgotPassword', () => {
describe('comingFrom login', () => {
beforeEach(() => {
wrapper = Wrapper(createMockObject('reset'))
wrapper = Wrapper(createMockObject('resetPassword'))
})
it('has another subtitle', () => {

View File

@ -38,11 +38,11 @@
</div>
</template>
<script>
import { sendResetPasswordEmail } from '../../graphql/queries'
import InputEmail from '../../components/Inputs/InputEmail'
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',
@ -57,7 +57,7 @@ const textFields = {
}
export default {
name: 'password',
name: 'ForgotPassword',
components: {
InputEmail,
},
@ -80,10 +80,10 @@ export default {
},
})
.then(() => {
this.$router.push('/thx/password')
this.$router.push('/thx/forgotPassword')
})
.catch(() => {
this.$router.push('/thx/password')
this.$router.push('/thx/forgotPassword')
})
},
},

View File

@ -2,7 +2,7 @@ import { RouterLinkStub, mount } from '@vue/test-utils'
import flushPromises from 'flush-promises'
import Login from './Login'
import { toastErrorSpy } from '../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
const localVue = global.localVue
@ -136,8 +136,8 @@ describe('Login', () => {
)
})
it('links to /password when clicking "Forgot Password"', () => {
expect(wrapper.findAllComponents(RouterLinkStub).at(0).props().to).toBe('/password')
it('links to /forgot-password when clicking "Forgot Password"', () => {
expect(wrapper.findAllComponents(RouterLinkStub).at(0).props().to).toBe('/forgot-password')
})
it('has a link "Create new account"', () => {
@ -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')
})
})
})

View File

@ -44,7 +44,7 @@
</b-card>
<b-row class="mt-3">
<b-col cols="6" class="text-center text-sm-left col-12 col-sm-6 pb-5">
<router-link to="/password" class="mt-3">
<router-link to="/forgot-password" class="mt-3">
{{ $t('settings.password.forgot_pwd') }}
</router-link>
</b-col>
@ -60,13 +60,13 @@
</div>
</template>
<script>
import InputPassword from '../../components/Inputs/InputPassword'
import InputEmail from '../../components/Inputs/InputEmail'
import { login } from '../../graphql/queries'
import { getCommunityInfoMixin } from '../../mixins/getCommunityInfo'
import InputPassword from '@/components/Inputs/InputPassword'
import InputEmail from '@/components/Inputs/InputEmail'
import { login } from '@/graphql/queries'
import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
export default {
name: 'login',
name: 'Login',
components: {
InputPassword,
InputEmail,
@ -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()
})

View File

@ -1,11 +1,11 @@
import { mount } from '@vue/test-utils'
import AccountOverview from './AccountOverview'
import Overview from './Overview'
const localVue = global.localVue
window.scrollTo = jest.fn()
describe('AccountOverview', () => {
describe('Overview', () => {
let wrapper
const mocks = {
@ -14,7 +14,7 @@ describe('AccountOverview', () => {
}
const Wrapper = () => {
return mount(AccountOverview, {
return mount(Overview, {
localVue,
mocks,
})

View File

@ -27,9 +27,9 @@
</div>
</template>
<script>
import Status from '../../components/Status.vue'
import GddTransactionList from './AccountOverview/GddTransactionList.vue'
import GddTransactionListFooter from './AccountOverview/GddTransactionListFooter.vue'
import Status from '@/components/Status.vue'
import GddTransactionList from '@/components/GddTransactionList.vue'
import GddTransactionListFooter from '@/components/GddTransactionListFooter.vue'
export default {
name: 'Overview',

View File

@ -0,0 +1,46 @@
import { shallowMount } from '@vue/test-utils'
import Profile from './Profile'
const localVue = global.localVue
describe('Profile', () => {
let wrapper
const mocks = {
$t: jest.fn((t) => t),
}
const Wrapper = () => {
return shallowMount(Profile, { localVue, mocks })
}
describe('shallow Mount', () => {
beforeEach(() => {
wrapper = Wrapper()
})
it('has a user card', () => {
expect(wrapper.findComponent({ name: 'UserCard' }).exists()).toBeTruthy()
})
it('has a user first and last name form', () => {
expect(wrapper.findComponent({ name: 'UserData' }).exists()).toBeTruthy()
})
it('has a user change language form', () => {
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 './UserProfile/UserCard.vue'
import FormUserData from './UserProfile/UserCard_FormUserData.vue'
import FormUserPasswort from './UserProfile/UserCard_FormUserPasswort.vue'
import FormUserLanguage from './UserProfile/UserCard_Language.vue'
import FormUserNewsletter from './UserProfile/UserCard_Newsletter.vue'
import FormUserCoinAnimation from './UserProfile/UserCard_CoinAnimation.vue'
import UserCard from '@/components/UserCard.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: 'UserProfile',
name: 'Profile',
components: {
UserCard,
FormUserData,
FormUserPasswort,
FormUserLanguage,
FormUserNewsletter,
FormUserCoinAnimation,
UserData,
UserPassword,
UserLanguage,
UserNewsletter,
UserCoinAnimation,
},
props: {
balance: { type: Number, default: 0 },

View File

@ -2,7 +2,7 @@ import { mount, RouterLinkStub } from '@vue/test-utils'
import flushPromises from 'flush-promises'
import Register from './Register'
import { toastErrorSpy } from '../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
const localVue = global.localVue

View File

@ -188,14 +188,14 @@
</div>
</template>
<script>
import InputEmail from '../../components/Inputs/InputEmail.vue'
import LanguageSwitchSelect from '../../components/LanguageSwitchSelect.vue'
import { createUser } from '../../graphql/mutations'
import { getCommunityInfoMixin } from '../../mixins/getCommunityInfo'
import InputEmail from '@/components/Inputs/InputEmail.vue'
import LanguageSwitchSelect from '@/components/LanguageSwitchSelect.vue'
import { createUser } from '@/graphql/mutations'
import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
export default {
components: { InputEmail, LanguageSwitchSelect },
name: 'register',
name: 'Register',
mixins: [getCommunityInfoMixin],
data() {
return {

View File

@ -1,7 +1,7 @@
import { mount, RouterLinkStub } from '@vue/test-utils'
import RegisterCommunity from './RegisterCommunity'
import { toastErrorSpy } from '../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
const localVue = global.localVue

View File

@ -49,10 +49,10 @@
</div>
</template>
<script>
import { getCommunityInfoMixin } from '../../mixins/getCommunityInfo'
import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
export default {
name: 'registerCommunity',
name: 'RegisterCommunity',
mixins: [getCommunityInfoMixin],
}
</script>

View File

@ -2,9 +2,9 @@ import { mount, RouterLinkStub } from '@vue/test-utils'
import ResetPassword from './ResetPassword'
import flushPromises from 'flush-promises'
import { toastErrorSpy } from '../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
// validation is tested in src/views/Pages/UserProfile/UserCard_FormUserPasswort.spec.js
// validation is tested in src/components/UserSettings/UserPassword.spec.js
const localVue = global.localVue
@ -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 /password/reset', () => {
expect(routerPushMock).toHaveBeenCalledWith('/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')
})
})
})

View File

@ -44,8 +44,8 @@
</div>
</template>
<script>
import InputPasswordConfirmation from '../../components/Inputs/InputPasswordConfirmation'
import { setPassword } from '../../graphql/mutations'
import InputPasswordConfirmation from '@/components/Inputs/InputPasswordConfirmation'
import { setPassword } from '@/graphql/mutations'
const textFields = {
reset: {
@ -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('/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
}
},

View File

@ -1,8 +1,8 @@
import { mount, RouterLinkStub } from '@vue/test-utils'
import { communities, communityInfo } from '../../graphql/queries'
import RegisterSelectCommunity from './RegisterSelectCommunity'
import { communities, communityInfo } from '@/graphql/queries'
import SelectCommunity from './SelectCommunity'
import { toastErrorSpy } from '../../../test/testSetup'
import { toastErrorSpy } from '@test/testSetup'
const localVue = global.localVue
@ -56,7 +56,7 @@ const apolloQueryMock = jest
const mockStoreCommit = jest.fn()
describe('RegisterSelectCommunity', () => {
describe('SelectCommunity', () => {
let wrapper
const mocks = {
@ -86,7 +86,7 @@ describe('RegisterSelectCommunity', () => {
}
const Wrapper = () => {
return mount(RegisterSelectCommunity, { localVue, mocks, stubs })
return mount(SelectCommunity, { localVue, mocks, stubs })
}
describe('mount', () => {

View File

@ -48,11 +48,11 @@
</div>
</template>
<script>
import { communities } from '../../graphql/queries'
import { getCommunityInfoMixin } from '../../mixins/getCommunityInfo'
import { communities } from '@/graphql/queries'
import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo'
export default {
name: 'registerSelectCommunity',
name: 'SelectCommunity',
data() {
return {
communities: [],

View File

@ -1,5 +1,5 @@
import { mount } from '@vue/test-utils'
import SendOverview from './SendOverview'
import Send from './Send'
const sendMock = jest.fn()
sendMock.mockResolvedValue('success')
@ -8,7 +8,7 @@ const localVue = global.localVue
// window.scrollTo = jest.fn()
describe('SendOverview', () => {
describe('Send', () => {
let wrapper
const propsData = {
@ -32,7 +32,7 @@ describe('SendOverview', () => {
}
const Wrapper = () => {
return mount(SendOverview, { localVue, mocks, propsData })
return mount(Send, { localVue, mocks, propsData })
}
describe('mount', () => {

View File

@ -32,11 +32,12 @@
</div>
</template>
<script>
import GddSend from './SendOverview/GddSend.vue'
import TransactionForm from './SendOverview/GddSend/TransactionForm.vue'
import TransactionConfirmation from './SendOverview/GddSend/TransactionConfirmation.vue'
import TransactionResult from './SendOverview/GddSend/TransactionResult.vue'
import { sendCoins, sendCoinsPerLink } from '../../graphql/mutations.js'
import GddSend from '@/components/GddSend.vue'
import TransactionForm from '@/components/GddSend/TransactionForm.vue'
import TransactionConfirmation from '@/components/GddSend/TransactionConfirmation.vue'
import TransactionResult from '@/components/GddSend/TransactionResult.vue'
import { sendCoins, sendCoinsPerLink } from '@/graphql/mutations.js'
const EMPTY_TRANSACTION_DATA = {
email: '',
@ -45,7 +46,7 @@ const EMPTY_TRANSACTION_DATA = {
}
export default {
name: 'SendOverview',
name: 'Send',
components: {
GddSend,
TransactionForm,

View File

@ -1,11 +1,11 @@
import { mount } from '@vue/test-utils'
import UserProfileTransactionList from './UserProfileTransactionList'
import Transactions from './Transactions'
const localVue = global.localVue
window.scrollTo = jest.fn()
describe('UserProfileTransactionList', () => {
describe('Transactions', () => {
let wrapper
const mocks = {
@ -22,7 +22,7 @@ describe('UserProfileTransactionList', () => {
}
const Wrapper = () => {
return mount(UserProfileTransactionList, { localVue, mocks, stubs })
return mount(Transactions, { localVue, mocks, stubs })
}
describe('mount', () => {

View File

@ -26,11 +26,11 @@
</div>
</template>
<script>
import GddTransactionList from './AccountOverview/GddTransactionList.vue'
import GdtTransactionList from './AccountOverview/GdtTransactionList.vue'
import GddTransactionList from '@/components/GddTransactionList.vue'
import GdtTransactionList from '@/components/GdtTransactionList.vue'
export default {
name: 'UserProfileTransactionList',
name: 'Transactions',
components: {
GddTransactionList,
GdtTransactionList,

View File

@ -23,7 +23,7 @@ describe('Thx', () => {
describe('mount', () => {
beforeEach(() => {
wrapper = Wrapper(createMockObject('password'))
wrapper = Wrapper(createMockObject('forgotPassword'))
})
it('renders the thx page', () => {
@ -35,9 +35,9 @@ describe('Thx', () => {
})
})
describe('coming from /password', () => {
describe('coming from /forgot-password', () => {
beforeEach(() => {
wrapper = Wrapper(createMockObject('password'))
wrapper = Wrapper(createMockObject('forgotPassword'))
})
it('renders the thanks text', () => {
@ -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', () => {

View File

@ -18,13 +18,13 @@
</template>
<script>
const textFields = {
password: {
forgotPassword: {
headline: 'site.thx.title',
subtitle: 'site.thx.email',
button: 'login',
linkTo: '/login',
},
reset: {
resetPassword: {
headline: 'site.thx.title',
subtitle: 'site.thx.reset',
button: 'login',

View File

@ -41,7 +41,7 @@ describe('navigation guards', () => {
})
it('does not commit the pid when not present', async () => {
await router.push({ path: 'password' })
await router.push({ path: 'forgot-password' })
expect(storeCommitMock).not.toBeCalled()
})
})

View File

@ -1,5 +1,5 @@
import router from './router'
import NotFound from '@/views/NotFoundPage.vue'
import NotFound from '@/pages/NotFoundPage.vue'
describe('router', () => {
describe('options', () => {
@ -58,7 +58,7 @@ describe('router', () => {
expect(routes.find((r) => r.path === '/overview').meta.requiresAuth).toBeTruthy()
})
it('loads the "Overview" component', async () => {
it('loads the "Overview" page', async () => {
const component = await routes.find((r) => r.path === '/overview').component()
expect(component.default.name).toBe('Overview')
})
@ -69,9 +69,9 @@ describe('router', () => {
expect(routes.find((r) => r.path === '/send').meta.requiresAuth).toBeTruthy()
})
it('loads the "Send" component', async () => {
it('loads the "Send" page', async () => {
const component = await routes.find((r) => r.path === '/send').component()
expect(component.default.name).toBe('SendOverview')
expect(component.default.name).toBe('Send')
})
})
@ -80,9 +80,9 @@ describe('router', () => {
expect(routes.find((r) => r.path === '/profile').meta.requiresAuth).toBeTruthy()
})
it('loads the "UserProfile" component', async () => {
it('loads the "Profile" page', async () => {
const component = await routes.find((r) => r.path === '/profile').component()
expect(component.default.name).toBe('UserProfile')
expect(component.default.name).toBe('Profile')
})
})
@ -91,30 +91,30 @@ describe('router', () => {
expect(routes.find((r) => r.path === '/transactions').meta.requiresAuth).toBeTruthy()
})
it('loads the "UserProfileTransactionList" component', async () => {
it('loads the "Transactions" page', async () => {
const component = await routes.find((r) => r.path === '/transactions').component()
expect(component.default.name).toBe('UserProfileTransactionList')
expect(component.default.name).toBe('Transactions')
})
})
describe('login', () => {
it('loads the "Login" component', async () => {
it('loads the "Login" page', async () => {
const component = await routes.find((r) => r.path === '/login').component()
expect(component.default.name).toBe('login')
expect(component.default.name).toBe('Login')
})
})
describe('register', () => {
it('loads the "register" component', async () => {
it('loads the "register" page', async () => {
const component = await routes.find((r) => r.path === '/register').component()
expect(component.default.name).toBe('register')
expect(component.default.name).toBe('Register')
})
})
describe('thx', () => {
const thx = routes.find((r) => r.path === '/thx/:comingFrom')
it('loads the "Thx" component', async () => {
it('loads the "Thx" page', async () => {
const component = await thx.component()
expect(component.default.name).toBe('Thx')
})
@ -130,56 +130,60 @@ describe('router', () => {
it('enters the page when coming from a valid page', () => {
jest.resetAllMocks()
beforeEnter({}, { path: '/password' }, next)
beforeEnter({}, { path: '/forgot-password' }, next)
expect(next).toBeCalledWith()
})
})
})
describe('password', () => {
it('loads the "Password" component', async () => {
const component = await routes.find((r) => r.path === '/password').component()
expect(component.default.name).toBe('password')
describe('forgot password', () => {
it('loads the "ForgotPassword" page', async () => {
const component = await routes.find((r) => r.path === '/forgot-password').component()
expect(component.default.name).toBe('ForgotPassword')
})
})
describe('password with param comingFrom', () => {
it('loads the "Password" component', async () => {
const component = await routes.find((r) => r.path === '/password/:comingFrom').component()
expect(component.default.name).toBe('password')
it('loads the "ForgotPassword" page', async () => {
const component = await routes
.find((r) => r.path === '/forgot-password/:comingFrom')
.component()
expect(component.default.name).toBe('ForgotPassword')
})
})
describe('register-community', () => {
it('loads the "registerCommunity" component', async () => {
it('loads the "registerCommunity" page', async () => {
const component = await routes.find((r) => r.path === '/register-community').component()
expect(component.default.name).toBe('registerCommunity')
expect(component.default.name).toBe('RegisterCommunity')
})
})
describe('select-community', () => {
it('loads the "registerSelectCommunity" component', async () => {
it('loads the "SelectCommunity" page', async () => {
const component = await routes.find((r) => r.path === '/select-community').component()
expect(component.default.name).toBe('registerSelectCommunity')
expect(component.default.name).toBe('SelectCommunity')
})
})
describe('reset', () => {
it('loads the "ResetPassword" component', async () => {
const component = await routes.find((r) => r.path === '/reset/:optin').component()
describe('reset password', () => {
it('loads the "ResetPassword" page', async () => {
const component = await routes
.find((r) => r.path === '/reset-password/:optin')
.component()
expect(component.default.name).toBe('ResetPassword')
})
})
describe('checkEmail', () => {
it('loads the "CheckEmail" component', async () => {
it('loads the "CheckEmail" page', async () => {
const component = await routes.find((r) => r.path === '/checkEmail/:optin').component()
expect(component.default.name).toBe('ResetPassword')
})
})
describe('not found page', () => {
it('renders the "NotFound" component', async () => {
it('renders the "NotFound" page', async () => {
expect(routes.find((r) => r.path === '*').component).toEqual(NotFound)
})
})

Some files were not shown because too many files have changed in this diff Show More