1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2025-01-10 16:04:54 +01:00
Whalebird-desktop-client-ma.../spec/renderer/unit/store/TimelineSpace.spec.ts
2019-08-07 23:12:27 +09:00

39 lines
1.2 KiB
TypeScript

import TimelineSpace, { TimelineSpaceState, blankAccount, MUTATION_TYPES } from '~/src/renderer/store/TimelineSpace'
import unreadSettings from '~/src/constants/unreadNotification'
describe('TimelineSpace', () => {
describe('mutations', () => {
let state: TimelineSpaceState
beforeEach(() => {
state = {
account: blankAccount,
bindingAccount: null,
loading: false,
emojis: [],
tootMax: 500,
unreadNotification: {
direct: unreadSettings.Direct.default,
local: unreadSettings.Local.default,
public: unreadSettings.Public.default
},
pleroma: false
}
})
describe('updateTootMax', () => {
describe('value is null', () => {
it('should be updated with 500', () => {
TimelineSpace.mutations![MUTATION_TYPES.UPDATE_TOOT_MAX](state, null)
expect(state.tootMax).toEqual(500)
})
})
describe('value is not null', () => {
it('should be updated', () => {
TimelineSpace.mutations![MUTATION_TYPES.UPDATE_TOOT_MAX](state, 1200)
expect(state.tootMax).toEqual(1200)
})
})
})
})
})