2019-04-06 15:08:29 +02:00
|
|
|
import General, { GeneralState, MUTATION_TYPES } from '@/store/Preferences/General'
|
2018-12-30 07:27:46 +01:00
|
|
|
|
|
|
|
describe('Preferences/General', () => {
|
2019-04-06 15:08:29 +02:00
|
|
|
let state: GeneralState
|
2018-12-30 07:27:46 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
state = {
|
|
|
|
general: {
|
|
|
|
sound: {
|
|
|
|
fav_rb: true,
|
|
|
|
toot: true
|
2019-04-06 15:08:29 +02:00
|
|
|
},
|
|
|
|
timeline: {
|
|
|
|
cw: false,
|
2020-12-25 07:27:13 +01:00
|
|
|
nsfw: false,
|
2019-04-06 15:08:29 +02:00
|
|
|
hideAllAttachments: false
|
2019-09-23 15:54:37 +02:00
|
|
|
},
|
|
|
|
other: {
|
2021-03-25 11:04:31 +01:00
|
|
|
launch: false
|
2018-12-30 07:27:46 +01:00
|
|
|
}
|
|
|
|
},
|
|
|
|
loading: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('mutations', () => {
|
|
|
|
it('updateGeneral', () => {
|
2019-04-06 15:08:29 +02:00
|
|
|
General.mutations![MUTATION_TYPES.UPDATE_GENERAL](state, {
|
2018-12-30 07:27:46 +01:00
|
|
|
sound: {
|
|
|
|
fav_rb: false,
|
|
|
|
toot: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
expect(state.general.sound.fav_rb).toEqual(false)
|
|
|
|
expect(state.general.sound.toot).toEqual(false)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|