mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 2051-list-all-confirmed-contribution
This commit is contained in:
commit
ed75dce369
@ -59,6 +59,7 @@ export class ContributionResolver {
|
|||||||
order: {
|
order: {
|
||||||
createdAt: order,
|
createdAt: order,
|
||||||
},
|
},
|
||||||
|
withDeleted: true,
|
||||||
skip: (currentPage - 1) * pageSize,
|
skip: (currentPage - 1) * pageSize,
|
||||||
take: pageSize,
|
take: pageSize,
|
||||||
})
|
})
|
||||||
|
|||||||
@ -13,6 +13,7 @@ export const login = gql`
|
|||||||
hasElopage
|
hasElopage
|
||||||
publisherId
|
publisherId
|
||||||
isAdmin
|
isAdmin
|
||||||
|
creation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
@ -30,6 +31,7 @@ export const verifyLogin = gql`
|
|||||||
hasElopage
|
hasElopage
|
||||||
publisherId
|
publisherId
|
||||||
isAdmin
|
isAdmin
|
||||||
|
creation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|||||||
@ -47,6 +47,9 @@ export const mutations = {
|
|||||||
hasElopage: (state, hasElopage) => {
|
hasElopage: (state, hasElopage) => {
|
||||||
state.hasElopage = hasElopage
|
state.hasElopage = hasElopage
|
||||||
},
|
},
|
||||||
|
creation: (state, creation) => {
|
||||||
|
state.creation = creation
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const actions = {
|
export const actions = {
|
||||||
@ -60,6 +63,7 @@ export const actions = {
|
|||||||
commit('hasElopage', data.hasElopage)
|
commit('hasElopage', data.hasElopage)
|
||||||
commit('publisherId', data.publisherId)
|
commit('publisherId', data.publisherId)
|
||||||
commit('isAdmin', data.isAdmin)
|
commit('isAdmin', data.isAdmin)
|
||||||
|
commit('creation', data.creation)
|
||||||
},
|
},
|
||||||
logout: ({ commit, state }) => {
|
logout: ({ commit, state }) => {
|
||||||
commit('token', null)
|
commit('token', null)
|
||||||
@ -71,6 +75,7 @@ export const actions = {
|
|||||||
commit('hasElopage', false)
|
commit('hasElopage', false)
|
||||||
commit('publisherId', null)
|
commit('publisherId', null)
|
||||||
commit('isAdmin', false)
|
commit('isAdmin', false)
|
||||||
|
commit('creation', null)
|
||||||
localStorage.clear()
|
localStorage.clear()
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
@ -96,6 +101,7 @@ try {
|
|||||||
newsletterState: null,
|
newsletterState: null,
|
||||||
hasElopage: false,
|
hasElopage: false,
|
||||||
publisherId: null,
|
publisherId: null,
|
||||||
|
creation: null,
|
||||||
},
|
},
|
||||||
getters: {},
|
getters: {},
|
||||||
// Syncronous mutation of the state
|
// Syncronous mutation of the state
|
||||||
|
|||||||
@ -30,6 +30,7 @@ const {
|
|||||||
publisherId,
|
publisherId,
|
||||||
isAdmin,
|
isAdmin,
|
||||||
hasElopage,
|
hasElopage,
|
||||||
|
creation,
|
||||||
} = mutations
|
} = mutations
|
||||||
const { login, logout } = actions
|
const { login, logout } = actions
|
||||||
|
|
||||||
@ -139,6 +140,14 @@ describe('Vuex store', () => {
|
|||||||
expect(state.hasElopage).toBeTruthy()
|
expect(state.hasElopage).toBeTruthy()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('creation', () => {
|
||||||
|
it('sets the state of creation', () => {
|
||||||
|
const state = { creation: null }
|
||||||
|
creation(state, true)
|
||||||
|
expect(state.creation).toEqual(true)
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('actions', () => {
|
describe('actions', () => {
|
||||||
@ -156,11 +165,12 @@ describe('Vuex store', () => {
|
|||||||
hasElopage: false,
|
hasElopage: false,
|
||||||
publisherId: 1234,
|
publisherId: 1234,
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
|
creation: ['1000', '1000', '1000'],
|
||||||
}
|
}
|
||||||
|
|
||||||
it('calls nine commits', () => {
|
it('calls nine commits', () => {
|
||||||
login({ commit, state }, commitedData)
|
login({ commit, state }, commitedData)
|
||||||
expect(commit).toHaveBeenCalledTimes(8)
|
expect(commit).toHaveBeenCalledTimes(9)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('commits email', () => {
|
it('commits email', () => {
|
||||||
@ -202,6 +212,11 @@ describe('Vuex store', () => {
|
|||||||
login({ commit, state }, commitedData)
|
login({ commit, state }, commitedData)
|
||||||
expect(commit).toHaveBeenNthCalledWith(8, 'isAdmin', true)
|
expect(commit).toHaveBeenNthCalledWith(8, 'isAdmin', true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('commits creation', () => {
|
||||||
|
login({ commit, state }, commitedData)
|
||||||
|
expect(commit).toHaveBeenNthCalledWith(9, 'creation', ['1000', '1000', '1000'])
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe('logout', () => {
|
describe('logout', () => {
|
||||||
@ -210,7 +225,7 @@ describe('Vuex store', () => {
|
|||||||
|
|
||||||
it('calls nine commits', () => {
|
it('calls nine commits', () => {
|
||||||
logout({ commit, state })
|
logout({ commit, state })
|
||||||
expect(commit).toHaveBeenCalledTimes(8)
|
expect(commit).toHaveBeenCalledTimes(9)
|
||||||
})
|
})
|
||||||
|
|
||||||
it('commits token', () => {
|
it('commits token', () => {
|
||||||
@ -253,6 +268,11 @@ describe('Vuex store', () => {
|
|||||||
expect(commit).toHaveBeenNthCalledWith(8, 'isAdmin', false)
|
expect(commit).toHaveBeenNthCalledWith(8, 'isAdmin', false)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('commits creation', () => {
|
||||||
|
logout({ commit, state })
|
||||||
|
expect(commit).toHaveBeenNthCalledWith(9, 'creation', null)
|
||||||
|
})
|
||||||
|
|
||||||
// how to get this working?
|
// how to get this working?
|
||||||
it.skip('calls localStorage.clear()', () => {
|
it.skip('calls localStorage.clear()', () => {
|
||||||
const clearStorageMock = jest.fn()
|
const clearStorageMock = jest.fn()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user