adopt test without sessionId

This commit is contained in:
Moriz Wahl 2021-08-30 17:41:26 +02:00
parent 60fa39c7e8
commit ce2826388e
9 changed files with 6 additions and 35 deletions

View File

@ -15,7 +15,6 @@ describe('LanguageSwitch', () => {
let wrapper
const state = {
sessionId: 1234,
email: 'he@ho.he',
language: null,
}
@ -123,7 +122,6 @@ describe('LanguageSwitch', () => {
expect(updateUserInfosQueryMock).toBeCalledWith(
expect.objectContaining({
variables: {
sessionId: 1234,
email: 'he@ho.he',
locale: 'en',
},
@ -136,7 +134,6 @@ describe('LanguageSwitch', () => {
expect(updateUserInfosQueryMock).toBeCalledWith(
expect.objectContaining({
variables: {
sessionId: 1234,
email: 'he@ho.he',
locale: 'de',
},

View File

@ -32,7 +32,7 @@ export default {
localeChanged(locale)
},
async saveLocale(locale) {
if (this.$i18n.locale === locale) return
// if (this.$i18n.locale === locale) return
this.setLocale(locale)
if (this.$store.state.email) {
this.$apollo

View File

@ -41,7 +41,6 @@ describe('DashboardLayoutGdd', () => {
},
$store: {
state: {
sessionId: 1,
email: 'user@example.org',
},
dispatch: storeDispatchMock,
@ -133,11 +132,7 @@ describe('DashboardLayoutGdd', () => {
})
it('calls the API', async () => {
expect(apolloMock).toBeCalledWith(
expect.objectContaining({
variables: { sessionId: 1 },
}),
)
expect(apolloMock).toBeCalled()
})
it('dispatches logout to store', () => {
@ -196,7 +191,6 @@ describe('DashboardLayoutGdd', () => {
expect(apolloMock).toBeCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
firstPage: 2,
items: 5,
},

View File

@ -16,12 +16,12 @@ describe('AccountOverview', () => {
const mocks = {
$t: jest.fn((t) => t),
$n: jest.fn((n) => String(n)),
$store: {
state: {
sessionId: 1,
email: 'sender@example.org',
},
},
$n: jest.fn((n) => String(n)),
$apollo: {
query: sendMock,
},
@ -93,7 +93,6 @@ describe('AccountOverview', () => {
expect(sendMock).toBeCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
email: 'user@example.org',
amount: 23.45,
memo: 'Make the best of it!',

View File

@ -6,12 +6,7 @@ const localVue = global.localVue
const loginQueryMock = jest.fn().mockResolvedValue({
data: {
login: {
sessionId: 1,
user: {
name: 'Peter Lustig',
},
},
login: 'token',
},
})
@ -159,10 +154,7 @@ describe('Login', () => {
describe('login success', () => {
it('dispatches server response to store', () => {
expect(mockStoreDispach).toBeCalledWith('login', {
sessionId: 1,
user: { name: 'Peter Lustig' },
})
expect(mockStoreDispach).toBeCalledWith('login', 'token')
})
it('redirects to overview page', () => {

View File

@ -17,7 +17,6 @@ describe('UserCard_FormUserData', () => {
$t: jest.fn((t) => t),
$store: {
state: {
sessionId: 1,
email: 'user@example.org',
firstName: 'Peter',
lastName: 'Lustig',
@ -118,7 +117,6 @@ describe('UserCard_FormUserData', () => {
expect(mockAPIcall).toBeCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
email: 'user@example.org',
firstName: 'Petra',
lastName: 'Lustiger',
@ -167,7 +165,6 @@ describe('UserCard_FormUserData', () => {
expect(mockAPIcall).toBeCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
email: 'user@example.org',
firstName: 'Petra',
lastName: 'Lustiger',

View File

@ -14,7 +14,6 @@ describe('UserCard_FormUserMail', () => {
$t: jest.fn((t) => t),
$store: {
state: {
sessionId: 1,
email: 'user@example.org',
firstName: 'Peter',
lastName: 'Lustig',
@ -76,7 +75,6 @@ describe('UserCard_FormUserMail', () => {
expect(mockAPIcall).toHaveBeenCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
email: 'user@example.org',
newEmail: 'test@example.org',
},
@ -106,7 +104,6 @@ describe('UserCard_FormUserMail', () => {
expect(mockAPIcall).toHaveBeenCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
email: 'user@example.org',
newEmail: 'test@example.org',
},

View File

@ -17,7 +17,6 @@ describe('UserCard_FormUserPasswort', () => {
$t: jest.fn((t) => t),
$store: {
state: {
sessionId: 1,
email: 'user@example.org',
},
},
@ -175,7 +174,6 @@ describe('UserCard_FormUserPasswort', () => {
expect(changePasswordProfileMock).toHaveBeenCalledWith(
expect.objectContaining({
variables: {
sessionId: 1,
email: 'user@example.org',
password: '1234',
passwordNew: 'Aa123456',

View File

@ -25,7 +25,6 @@ describe('UserCard_FormUsername', () => {
$t: jest.fn((t) => t),
$store: {
state: {
sessionId: 1,
email: 'user@example.org',
username: '',
},
@ -111,7 +110,6 @@ describe('UserCard_FormUsername', () => {
expect.objectContaining({
variables: {
email: 'user@example.org',
sessionId: 1,
username: 'username',
},
}),
@ -151,7 +149,6 @@ describe('UserCard_FormUsername', () => {
expect.objectContaining({
variables: {
email: 'user@example.org',
sessionId: 1,
username: 'username',
},
}),