mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
38 lines
689 B
JavaScript
38 lines
689 B
JavaScript
import { shallowMount, createLocalVue } from '@vue/test-utils'
|
|
import Ribbon from './index'
|
|
|
|
const localVue = createLocalVue()
|
|
|
|
describe('Ribbon', () => {
|
|
let text
|
|
|
|
const Wrapper = () => {
|
|
return shallowMount(Ribbon, {
|
|
localVue,
|
|
propsData: {
|
|
text,
|
|
},
|
|
})
|
|
}
|
|
|
|
describe('given String for Text', () => {
|
|
beforeEach(() => {
|
|
text = 'Peter Pan'
|
|
})
|
|
|
|
it('shows Text', () => {
|
|
expect(Wrapper().text()).toContain('Peter Pan')
|
|
})
|
|
})
|
|
|
|
describe('given no String for Text', () => {
|
|
beforeEach(() => {
|
|
text = undefined
|
|
})
|
|
|
|
it('shows empty Text', () => {
|
|
expect(Wrapper().text()).toContain('')
|
|
})
|
|
})
|
|
})
|