2019-04-06 15:08:29 +02:00
|
|
|
import Notification, { NotificationState, MUTATION_TYPES } from '@/store/Preferences/Notification'
|
2018-12-30 08:56:38 +01:00
|
|
|
|
|
|
|
describe('Preferences/Notification', () => {
|
2019-04-06 15:08:29 +02:00
|
|
|
let state: NotificationState
|
2018-12-30 08:56:38 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
state = {
|
|
|
|
notification: {
|
|
|
|
notify: {
|
|
|
|
reply: true,
|
|
|
|
reblog: true,
|
|
|
|
favourite: true,
|
|
|
|
follow: true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
describe('mutations', () => {
|
|
|
|
it('updateNotification', () => {
|
2019-04-06 15:08:29 +02:00
|
|
|
Notification.mutations![MUTATION_TYPES.UPDATE_NOTIFICATION](state, {
|
2018-12-30 08:56:38 +01:00
|
|
|
notify: {
|
|
|
|
reply: false,
|
|
|
|
reblog: false,
|
|
|
|
favourite: false,
|
|
|
|
follow: false
|
|
|
|
}
|
|
|
|
})
|
|
|
|
expect(state.notification.notify).toEqual({
|
|
|
|
reply: false,
|
|
|
|
reblog: false,
|
|
|
|
favourite: false,
|
|
|
|
follow: false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|