Files
mes-ui-d2/tests/unit/d2-icon.spec.js
孙昊翔 4ef91111e3 unit test: d2-count-up d2-icon
Former-commit-id: 7fad78a4b7f62ebe674342e8154f4497b79c5b06 [formerly 7fad78a4b7f62ebe674342e8154f4497b79c5b06 [formerly 7fad78a4b7f62ebe674342e8154f4497b79c5b06 [formerly 7fad78a4b7f62ebe674342e8154f4497b79c5b06 [formerly e6036f61ab8105232d3e57f6c84182c092a74fd1 [formerly 17cf5e498be64a1c9b05456ff022241537957376]]]]]
Former-commit-id: c7f917c0128ec8867cd96710c7bcceba63c62dfd
Former-commit-id: 9dff6eabb4254aa4e4807a58c961532dc5d8b47e
Former-commit-id: 68bd970afdebd5c56bd0e72ffe871d687eccee69 [formerly 534cc268a850f9743ea398eae910dd1419b3b497]
Former-commit-id: eace96ad1ee3407d93f3a87385fc13d6ee1936c3
Former-commit-id: c448d93d9f03dee110afba702f83e77cb36002dc
Former-commit-id: bfefc7d1f57c67106a4da79e77682e33804630ed
Former-commit-id: 65193bd67cb7775646fead1ecc77250cd5427d50
Former-commit-id: 20df260fbe97beba5badc5e31af3131ad510a7b2
2019-01-04 15:26:25 +08:00

32 lines
765 B
JavaScript

import { mount } from '@vue/test-utils'
import D2Icon from '@/components/d2-icon/index.vue'
describe('d2-icon.vue', () => {
// 存在且是Vue组件实例
it('is a vue instance', () => {
const wrapper = mount(D2Icon)
expect(wrapper.exists()).toBeTruthy()
expect(wrapper.isVueInstance()).toBeTruthy()
})
// 包含特定类名
it('contains specific classnames', () => {
const wrapper = mount(D2Icon)
expect(wrapper.is('.fa')).toBeTruthy()
expect(wrapper.contains('.fa-font-awesome')).toBeTruthy()
})
// name prop
it('has a property named \'name\'', () => {
const wrapper = mount(D2Icon, {
propsData: {
name: 'font-awesome'
}
})
expect(wrapper.props().name).toEqual('font-awesome')
})
})