mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
feat(frontend): preserve email after login
This commit is contained in:
parent
42fc9501c0
commit
c95ecd1941
@ -29,10 +29,7 @@
|
||||
</div>
|
||||
<div>
|
||||
<div data-test="navbar-item-username">{{ username.username }}</div>
|
||||
|
||||
<div data-test="navbar-item-email">
|
||||
{{ $store.state.email }}
|
||||
</div>
|
||||
<div data-test="navbar-item-email">{{ $store.state.email }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</router-link>
|
||||
|
||||
@ -146,6 +146,10 @@ describe('Login', () => {
|
||||
expect(mockStoreDispach).toBeCalledWith('login', 'token')
|
||||
})
|
||||
|
||||
it('commits email to store', () => {
|
||||
expect(mockStoreCommit).toBeCalledWith('email', 'user@example.org')
|
||||
})
|
||||
|
||||
it('hides the spinner', () => {
|
||||
expect(spinnerHideMock).toBeCalled()
|
||||
})
|
||||
|
||||
@ -100,6 +100,7 @@ export default {
|
||||
data: { login },
|
||||
} = result
|
||||
this.$store.dispatch('login', login)
|
||||
this.$store.commit('email', this.form.email)
|
||||
await loader.hide()
|
||||
if (this.$route.params.code) {
|
||||
this.$router.push(`/redeem/${this.$route.params.code}`)
|
||||
|
||||
@ -54,7 +54,7 @@ export const mutations = {
|
||||
state.hideAmountGDT = !!hideAmountGDT
|
||||
},
|
||||
email: (state, email) => {
|
||||
state.email = email ||''
|
||||
state.email = email || ''
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@ -325,8 +325,8 @@ describe('Vuex store', () => {
|
||||
it('commits email', () => {
|
||||
logout({ commit, state })
|
||||
expect(commit).toHaveBeenNthCalledWith(12, 'email', '')
|
||||
})
|
||||
|
||||
})
|
||||
|
||||
// how to get this working?
|
||||
it.skip('calls localStorage.clear()', () => {
|
||||
const clearStorageMock = jest.fn()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user