You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
/* eslint-disable */
|
|
|
|
import UserStore from 'src/store/user'
|
|
|
|
describe('UserStore', () => {
|
|
|
|
it('should initialize login process',() => {
|
|
const state = {}
|
|
UserStore.mutations.loginRequesting(state)
|
|
expect(state.loginRequesting).toBe(true)
|
|
expect(state.loginSucceeded).toBe(false)
|
|
expect(state.loginError).toBe(null)
|
|
})
|
|
|
|
it('should login successfully',() => {
|
|
const state = {}
|
|
UserStore.mutations.loginSucceeded(state, {
|
|
jwt: '1234',
|
|
subscriberId: '5678'
|
|
})
|
|
expect(state.loginRequesting).toBe(false)
|
|
expect(state.loginSucceeded).toBe(true)
|
|
expect(state.loginError).toBe(null)
|
|
expect(state.jwt).toBe('1234')
|
|
expect(state.subscriberId).toBe('5678')
|
|
})
|
|
|
|
it('should successfully store a qrcode ',() => {
|
|
const dataImg = 'data:image;123456789'
|
|
const state = {}
|
|
UserStore.mutations.setQrCode(state, dataImg)
|
|
expect(state.qrCode).toBe(dataImg)
|
|
})
|
|
|
|
})
|