Robert Schäfer f5afdf2435 Merge Notification with NotificationPostCard
cc @mattwr18 Please don't see this as a revert of your work. Your
structure of the `notification-post-card` component was helpful and showed
the redundancy with `hc-post-card`. I reused a lot of the code, but
because I merged both components it now *looks* as if I authored all the code.
2019-04-17 01:10:17 +02:00

49 lines
905 B
JavaScript

import { config, mount, createLocalVue, RouterLinkStub } from '@vue/test-utils'
import Notification from '.'
import Styleguide from '@human-connection/styleguide'
const localVue = createLocalVue()
localVue.use(Styleguide)
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")
})
})
})