mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
* refactor(graphql): Introduce image type * Undo changes to .travis.yml * chore: Upgrade travis to node LTS - URL is available since v10 * chore: use lts Co-authored-by: mattwr18 <mattwr18@gmail.com>
31 lines
727 B
JavaScript
31 lines
727 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().contains('.hc-badges')).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().contains('img[src="/api/path/to/some/icon"]')).toBe(true)
|
|
})
|
|
})
|
|
})
|
|
})
|