2019-04-06 22:08:29 +09:00
|
|
|
import Notification, { NotificationState, MUTATION_TYPES } from '@/store/Preferences/Notification'
|
2018-12-30 16:56:38 +09:00
|
|
|
|
|
|
|
describe('Preferences/Notification', () => {
|
2019-04-06 22:08:29 +09:00
|
|
|
let state: NotificationState
|
2018-12-30 16:56:38 +09:00
|
|
|
beforeEach(() => {
|
|
|
|
state = {
|
|
|
|
notification: {
|
|
|
|
notify: {
|
|
|
|
reply: true,
|
|
|
|
reblog: true,
|
|
|
|
favourite: true,
|
2020-04-25 21:25:28 +09:00
|
|
|
follow: true,
|
2020-05-23 23:21:33 +09:00
|
|
|
follow_request: true,
|
2021-03-02 11:28:03 +09:00
|
|
|
reaction: true,
|
2021-03-21 21:27:47 +09:00
|
|
|
status: true,
|
2021-03-24 01:28:10 +09:00
|
|
|
poll_vote: true,
|
|
|
|
poll_expired: true
|
2018-12-30 16:56:38 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
describe('mutations', () => {
|
|
|
|
it('updateNotification', () => {
|
2019-04-06 22:08:29 +09:00
|
|
|
Notification.mutations![MUTATION_TYPES.UPDATE_NOTIFICATION](state, {
|
2018-12-30 16:56:38 +09:00
|
|
|
notify: {
|
|
|
|
reply: false,
|
|
|
|
reblog: false,
|
|
|
|
favourite: false,
|
2021-03-02 11:28:03 +09:00
|
|
|
follow: false,
|
|
|
|
follow_request: false,
|
|
|
|
reaction: false,
|
2021-03-24 00:46:31 +09:00
|
|
|
status: false,
|
2021-03-24 01:28:10 +09:00
|
|
|
poll_vote: false,
|
|
|
|
poll_expired: false
|
2018-12-30 16:56:38 +09:00
|
|
|
}
|
|
|
|
})
|
|
|
|
expect(state.notification.notify).toEqual({
|
|
|
|
reply: false,
|
|
|
|
reblog: false,
|
|
|
|
favourite: false,
|
2021-03-02 11:28:03 +09:00
|
|
|
follow: false,
|
|
|
|
follow_request: false,
|
|
|
|
reaction: false,
|
2021-03-24 00:46:31 +09:00
|
|
|
status: false,
|
2021-03-24 01:28:10 +09:00
|
|
|
poll_vote: false,
|
|
|
|
poll_expired: false
|
2018-12-30 16:56:38 +09:00
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|