2023-01-01 17:12:53 +01:00
|
|
|
import TimelineSpace, { TimelineSpaceState, MUTATION_TYPES } from '~/src/renderer/store/TimelineSpace'
|
2022-01-01 14:41:28 +01:00
|
|
|
import { DefaultSetting } from '~/src/constants/initializer/setting'
|
2019-01-20 14:44:03 +01:00
|
|
|
|
|
|
|
describe('TimelineSpace', () => {
|
|
|
|
describe('mutations', () => {
|
2019-04-07 15:48:37 +02:00
|
|
|
let state: TimelineSpaceState
|
2019-01-20 14:44:03 +01:00
|
|
|
beforeEach(() => {
|
|
|
|
state = {
|
2023-01-01 17:12:53 +01:00
|
|
|
account: null,
|
|
|
|
server: null,
|
2019-01-20 14:44:03 +01:00
|
|
|
loading: false,
|
|
|
|
emojis: [],
|
|
|
|
tootMax: 500,
|
2023-01-01 17:12:53 +01:00
|
|
|
setting: DefaultSetting,
|
2021-05-21 18:43:27 +02:00
|
|
|
filters: []
|
2019-01-20 14:44:03 +01:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('updateTootMax', () => {
|
|
|
|
describe('value is null', () => {
|
|
|
|
it('should be updated with 500', () => {
|
2019-04-07 15:48:37 +02:00
|
|
|
TimelineSpace.mutations![MUTATION_TYPES.UPDATE_TOOT_MAX](state, null)
|
2019-01-20 14:44:03 +01:00
|
|
|
expect(state.tootMax).toEqual(500)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
describe('value is not null', () => {
|
|
|
|
it('should be updated', () => {
|
2019-04-07 15:48:37 +02:00
|
|
|
TimelineSpace.mutations![MUTATION_TYPES.UPDATE_TOOT_MAX](state, 1200)
|
2019-01-20 14:44:03 +01:00
|
|
|
expect(state.tootMax).toEqual(1200)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|