1
0
mirror of https://github.com/h3poteto/whalebird-desktop synced 2024-12-11 16:37:27 +01:00
Whalebird-desktop-client-ma.../spec/renderer/unit/store/TimelineSpace.spec.ts
2023-01-13 00:30:16 +09:00

35 lines
1009 B
TypeScript

import TimelineSpace, { TimelineSpaceState, MUTATION_TYPES } from '~/src/renderer/store/TimelineSpace'
import { DefaultSetting } from '~/src/constants/initializer/setting'
describe('TimelineSpace', () => {
describe('mutations', () => {
let state: TimelineSpaceState
beforeEach(() => {
state = {
account: null,
server: null,
loading: false,
emojis: [],
tootMax: 500,
setting: DefaultSetting,
filters: []
}
})
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)
})
})
})
})
})