mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
31 lines
737 B
JavaScript
31 lines
737 B
JavaScript
import { shallowMount } from '@vue/test-utils'
|
|
import Badges from './Badges.vue'
|
|
|
|
describe('Badges.vue', () => {
|
|
let propsData
|
|
|
|
beforeEach(() => {
|
|
propsData = {}
|
|
})
|
|
|
|
describe('shallowMount', () => {
|
|
const Wrapper = () => {
|
|
return shallowMount(Badges, { propsData })
|
|
}
|
|
|
|
it('has class "hc-badges"', () => {
|
|
expect(Wrapper().find('.hc-badges').exists()).toBe(true)
|
|
})
|
|
|
|
describe('given a badge', () => {
|
|
beforeEach(() => {
|
|
propsData.badges = [{ id: '1', icon: '/path/to/some/icon' }]
|
|
})
|
|
|
|
it('proxies badge icon, which is just a URL without metadata', () => {
|
|
expect(Wrapper().find('img[src="/api/path/to/some/icon"]').exists()).toBe(true)
|
|
})
|
|
})
|
|
})
|
|
})
|