fix some tests

This commit is contained in:
Ulf Gebhardt 2026-01-16 21:37:28 +01:00
parent bd8d3e9259
commit 0ce245b252
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
3 changed files with 13 additions and 0 deletions

View File

@ -51,13 +51,17 @@ describe('PostTeaser', () => {
}
getters = {
'auth/isModerator': () => false,
'auth/isAdmin': () => false,
'auth/user': () => {
return {}
},
'categories/categoriesActive': () => false,
'pinnedPosts/maxPinnedPosts': () => 0,
'pinnedPosts/currentlyPinnedPosts': () => 0,
}
actions = {
'categories/init': jest.fn(),
'pinnedPosts/fetch': jest.fn().mockResolvedValue(),
}
})

View File

@ -16,9 +16,14 @@ const stubs = {
describe('SearchResults', () => {
let mocks, getters, propsData, wrapper
const Wrapper = () => {
const store = new Vuex.Store({
getters,
actions: {
'categories/init': jest.fn(),
'pinnedPosts/fetch': jest.fn(),
},
})
return mount(SearchResults, { mocks, localVue, propsData, store, stubs })
}

View File

@ -78,7 +78,11 @@ describe('ProfileSlug', () => {
'auth/user': {
id: 'u23',
},
'auth/isAdmin': () => false,
'pinnedPosts/maxPinnedPosts': () => 0,
'pinnedPosts/currentlyPinnedPosts': () => 0,
},
dispatch: jest.fn().mockResolvedValue(),
}
})