test RESET_POST_TYPE

This commit is contained in:
Moriz Wahl 2023-06-02 19:08:45 +02:00
parent 72ef3fe6f2
commit ff41c04cf9

View File

@ -289,6 +289,27 @@ describe('mutations', () => {
})
})
describe('RESET_POST_TYPE', () => {
beforeEach(() => {
testMutation = () => {
mutations.RESET_POST_TYPE(state)
return getters.filter(state)
}
})
it('resets the post type filter, event start and order', () => {
state = {
filter: {
postType_in: ['Event'],
eventStart_gte: new Date(),
},
order: 'eventStart_asc',
}
expect(testMutation()).toEqual({})
expect(getters.orderBy(state)).toEqual('createdAt_desc')
})
})
describe('TOGGLE_EVENTS_ENDED', () => {
beforeEach(() => {
testMutation = (postType) => {