mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
test category filter by params
This commit is contained in:
parent
88143d7f02
commit
4535e5d9c5
@ -20,6 +20,8 @@ describe('PostIndex', () => {
|
||||
beforeEach(() => {
|
||||
mutations = {
|
||||
'posts/TOGGLE_ORDER': jest.fn(),
|
||||
'posts/RESET_CATEGORIES': jest.fn(),
|
||||
'posts/TOGGLE_CATEGORY': jest.fn(),
|
||||
}
|
||||
store = new Vuex.Store({
|
||||
getters: {
|
||||
@ -93,6 +95,23 @@ describe('PostIndex', () => {
|
||||
wrapper.find(HashtagsFilter).vm.$emit('clearSearch')
|
||||
expect(wrapper.vm.hashtag).toBeNull()
|
||||
})
|
||||
|
||||
describe('category filter', () => {
|
||||
beforeEach(() => {
|
||||
mocks.$route.query = {
|
||||
categoryId: 'cat3',
|
||||
}
|
||||
wrapper = Wrapper()
|
||||
})
|
||||
|
||||
it('resets the category filter', () => {
|
||||
expect(mutations['posts/RESET_CATEGORIES']).toBeCalled()
|
||||
})
|
||||
|
||||
it('sets the category', () => {
|
||||
expect(mutations['posts/TOGGLE_CATEGORY']).toBeCalledWith({}, 'cat3')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('mount', () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user