Robert Schäfer 512ef672bf
feat: Introduce graphql image type (#3043)
* 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>
2020-03-16 15:32:19 +01:00

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)
})
})
})
})