first commit
This commit is contained in:
30
ui/src/components/_base-icon.unit.js
Normal file
30
ui/src/components/_base-icon.unit.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import BaseIcon from './_base-icon.vue'
|
||||
|
||||
describe('@components/_base-icon', () => {
|
||||
it('renders a font-awesome icon', () => {
|
||||
const { element } = mount(BaseIcon, {
|
||||
propsData: {
|
||||
name: 'sync',
|
||||
},
|
||||
})
|
||||
|
||||
expect(element.tagName).toEqual('svg')
|
||||
expect(element.classList).toContain('svg-inline--fa', 'fa-sync', 'fa-w-16')
|
||||
})
|
||||
|
||||
it('renders a custom icon', () => {
|
||||
const { element } = shallowMount(BaseIcon, {
|
||||
...createComponentMocks({
|
||||
style: {
|
||||
iconCustomSomeIcon: 'generated-class-name',
|
||||
},
|
||||
}),
|
||||
propsData: {
|
||||
source: 'custom',
|
||||
name: 'some-icon',
|
||||
},
|
||||
})
|
||||
|
||||
expect(element.className).toEqual('generated-class-name')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user