mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
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.
49 lines
905 B
JavaScript
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")
|
|
})
|
|
})
|
|
})
|