2019-04-04 15:24:24 +02:00
|
|
|
import Login, { LoginState, MUTATION_TYPES } from '@/store/Login'
|
2018-12-28 16:04:17 +01:00
|
|
|
|
|
|
|
describe('Login', () => {
|
|
|
|
describe('mutations', () => {
|
2019-04-04 15:24:24 +02:00
|
|
|
let state: LoginState
|
2018-12-28 16:04:17 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
state = {
|
|
|
|
selectedInstance: null,
|
|
|
|
searching: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
describe('changeInstance', () => {
|
|
|
|
it('should be changed', () => {
|
2019-04-04 15:24:24 +02:00
|
|
|
Login.mutations![MUTATION_TYPES.CHANGE_INSTANCE](state, 'pleroma.io')
|
2018-12-28 16:04:17 +01:00
|
|
|
expect(state.selectedInstance).toEqual('pleroma.io')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
describe('changeSearching', () => {
|
|
|
|
it('should be changed', () => {
|
2019-04-04 15:24:24 +02:00
|
|
|
Login.mutations![MUTATION_TYPES.CHANGE_SEARCHING](state, true)
|
2018-12-28 16:04:17 +01:00
|
|
|
expect(state.searching).toEqual(true)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|