2018-12-28 16:04:17 +01:00
|
|
|
import Login from '@/store/Login'
|
|
|
|
|
|
|
|
describe('Login', () => {
|
|
|
|
describe('mutations', () => {
|
2019-03-25 13:51:24 +01:00
|
|
|
let state: any
|
2018-12-28 16:04:17 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
state = {
|
|
|
|
instances: [],
|
|
|
|
selectedInstance: null,
|
|
|
|
searching: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
describe('changeInstance', () => {
|
|
|
|
it('should be changed', () => {
|
|
|
|
Login.mutations.changeInstance(state, 'pleroma.io')
|
|
|
|
expect(state.selectedInstance).toEqual('pleroma.io')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
describe('changeSearching', () => {
|
|
|
|
it('should be changed', () => {
|
|
|
|
Login.mutations.changeSearching(state, true)
|
|
|
|
expect(state.searching).toEqual(true)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|