mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
more compact wrapper creation
This commit is contained in:
parent
8dd64f5452
commit
080f5f257a
@ -3,6 +3,17 @@ import Thx from './thx'
|
|||||||
|
|
||||||
const localVue = global.localVue
|
const localVue = global.localVue
|
||||||
|
|
||||||
|
const createMockObject = (comingFrom) => {
|
||||||
|
return {
|
||||||
|
$t: jest.fn((t) => t),
|
||||||
|
$route: {
|
||||||
|
params: {
|
||||||
|
comingFrom,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
describe('Thx', () => {
|
describe('Thx', () => {
|
||||||
let wrapper
|
let wrapper
|
||||||
|
|
||||||
@ -12,14 +23,7 @@ describe('Thx', () => {
|
|||||||
|
|
||||||
describe('mount', () => {
|
describe('mount', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = Wrapper({
|
wrapper = Wrapper(createMockObject('password'))
|
||||||
$t: jest.fn((t) => t),
|
|
||||||
$route: {
|
|
||||||
params: {
|
|
||||||
comingFrom: 'password',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the thx page', () => {
|
it('renders the thx page', () => {
|
||||||
@ -33,14 +37,7 @@ describe('Thx', () => {
|
|||||||
|
|
||||||
describe('coming from /password', () => {
|
describe('coming from /password', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = Wrapper({
|
wrapper = Wrapper(createMockObject('password'))
|
||||||
$t: jest.fn((t) => t),
|
|
||||||
$route: {
|
|
||||||
params: {
|
|
||||||
comingFrom: 'password',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the thanks text', () => {
|
it('renders the thanks text', () => {
|
||||||
@ -58,14 +55,7 @@ describe('Thx', () => {
|
|||||||
|
|
||||||
describe('coming from /reset', () => {
|
describe('coming from /reset', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = Wrapper({
|
wrapper = Wrapper(createMockObject('reset'))
|
||||||
$t: jest.fn((t) => t),
|
|
||||||
$route: {
|
|
||||||
params: {
|
|
||||||
comingFrom: 'reset',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the thanks text', () => {
|
it('renders the thanks text', () => {
|
||||||
@ -83,14 +73,7 @@ describe('Thx', () => {
|
|||||||
|
|
||||||
describe('coming from /register', () => {
|
describe('coming from /register', () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
wrapper = Wrapper({
|
wrapper = Wrapper(createMockObject('register'))
|
||||||
$t: jest.fn((t) => t),
|
|
||||||
$route: {
|
|
||||||
params: {
|
|
||||||
comingFrom: 'register',
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
it('renders the thanks text', () => {
|
it('renders the thanks text', () => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user