Robert Schäfer 055b79bfe2 RemoveLinks is better suited as a filter
Unfortunately with `v-html` you cannot use filters directly in
handlebars.
See: https://github.com/nuxt/nuxt.js/issues/231

I also fixed the tests even **without** mocking vue-filters.js plugin 👍
2019-04-17 01:54:53 +02:00

51 lines
971 B
JavaScript

import { config, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
import Notification from '.'
import Styleguide from '@human-connection/styleguide'
import Filters from '~/plugins/vue-filters'
const localVue = createLocalVue()
localVue.use(Styleguide)
localVue.use(Filters)
config.stubs['no-ssr'] = '<span><slot /></span>'
describe('Notification', () => {
let wrapper
let stubs
let mocks
let propsData
beforeEach(() => {
propsData = {}
mocks = {
$t: jest.fn()
}
stubs = {
NuxtLink: RouterLinkStub
}
})
const Wrapper = () => {
return mount(Notification, {
stubs,
mocks,
propsData,
localVue
})
}
describe('given a notification', () => {
beforeEach(() => {
propsData.notification = {
post: {
title: "It's a title"
}
}
})
it('renders title', () => {
expect(Wrapper().text()).toContain("It's a title")
})
})
})