UNPKG

fine-true

Version:

A small and beautiful Vue3 version of the UI Library

36 lines (31 loc) 782 B
import { mount } from '@vue/test-utils'; import Button from './index'; test('slot default', () => { const wrapper = mount(Button, { slots: { default: '按钮', }, }); expect(wrapper.text()).toContain('按钮'); }); test('props or attrs', () => { const wrapper = mount(Button, { slots: { default: '删除', }, props: { leftIcon: 'favorite-filling', size: 'mini', }, attrs: { disabled: true, }, }); expect(wrapper.html()).toContain('fine-icon icon-favorite-filling'); expect(wrapper.html()).toContain('5px;'); expect(wrapper.attributes()).toEqual({ disabled: '', class: 'fine-button fine-button-default fine-button-mini fine-button-disabled', }); });