yarn test fixed

This commit is contained in:
ogerly 2021-12-28 17:38:00 +01:00
parent 0ca0f49f3f
commit 53e25ab119
10 changed files with 16 additions and 3 deletions

View File

@ -8,6 +8,7 @@ const toastSuccessMock = jest.fn()
const toastErrorMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$apollo: {
mutate: apolloMutateMock,
},
@ -53,7 +54,7 @@ describe('ConfirmRegisterMailFormular', () => {
it('toasts a success message', () => {
expect(toastSuccessMock).toBeCalledWith(
'Erfolgreich senden der Confirmation Link an die E-Mail des Users! bob@baumeister.de',
'unregister_mail.success',
)
})
})
@ -67,7 +68,7 @@ describe('ConfirmRegisterMailFormular', () => {
it('toasts an error message', () => {
expect(toastErrorMock).toBeCalledWith(
'Fehler beim senden des confirmation link an den Benutzer: OUCH!',
'unregister_mail.error',
)
})
})

View File

@ -21,6 +21,7 @@ const toastedErrorMock = jest.fn()
const toastedSuccessMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$moment: jest.fn(() => {
return {
format: jest.fn((m) => m),

View File

@ -53,6 +53,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
const toastedErrorMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$apollo: {
query: apolloQueryMock,
},

View File

@ -18,6 +18,7 @@ const stateCommitMock = jest.fn()
const toastedErrorMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$moment: jest.fn(() => {
return {
format: jest.fn((m) => m),

View File

@ -7,6 +7,7 @@ const storeDispatchMock = jest.fn()
const routerPushMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$store: {
state: {
openCreations: 1,

View File

@ -13,8 +13,12 @@ describe('UserTable', () => {
creation: [],
}
const mocks = {
$t: jest.fn((t) => t),
}
const Wrapper = () => {
return mount(UserTable, { localVue, propsData })
return mount(UserTable, { localVue, propsData, mocks })
}
describe('mount', () => {

View File

@ -28,6 +28,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
const toastErrorMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$apollo: {
query: apolloQueryMock,
},

View File

@ -37,6 +37,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
const apolloMutateMock = jest.fn().mockResolvedValue({})
const mocks = {
$t: jest.fn((t) => t),
$store: {
commit: storeCommitMock,
},

View File

@ -22,6 +22,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
const storeCommitMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$apollo: {
query: apolloQueryMock,
},

View File

@ -20,6 +20,7 @@ const apolloQueryMock = jest.fn().mockResolvedValue({
const toastErrorMock = jest.fn()
const mocks = {
$t: jest.fn((t) => t),
$apollo: {
query: apolloQueryMock,
},