mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Fix specs
Destructuring `isModerator` and calling it in `displayAnonymous` lets `Notification.spec.js` fail. Adding the getter fixes it.
This commit is contained in:
parent
e04eedf0d0
commit
1a1f73e53e
@ -1,10 +1,12 @@
|
||||
import { config, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
|
||||
import Notification from './Notification'
|
||||
import Notification from './Notification.vue'
|
||||
import Styleguide from '@human-connection/styleguide'
|
||||
import Filters from '~/plugins/vue-filters'
|
||||
import Vuex from 'vuex'
|
||||
|
||||
const localVue = createLocalVue()
|
||||
|
||||
localVue.use(Vuex)
|
||||
localVue.use(Styleguide)
|
||||
localVue.use(Filters)
|
||||
|
||||
@ -12,6 +14,7 @@ config.stubs['client-only'] = '<span><slot /></span>'
|
||||
|
||||
describe('Notification', () => {
|
||||
let stubs
|
||||
let getters
|
||||
let mocks
|
||||
let propsData
|
||||
let wrapper
|
||||
@ -23,11 +26,21 @@ describe('Notification', () => {
|
||||
stubs = {
|
||||
NuxtLink: RouterLinkStub,
|
||||
}
|
||||
getters = {
|
||||
'auth/user': () => {
|
||||
return {}
|
||||
},
|
||||
'auth/isModerator': () => false,
|
||||
}
|
||||
})
|
||||
|
||||
const Wrapper = () => {
|
||||
const store = new Vuex.Store({
|
||||
getters,
|
||||
})
|
||||
return mount(Notification, {
|
||||
stubs,
|
||||
store,
|
||||
mocks,
|
||||
propsData,
|
||||
localVue,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user