import { mount } from '@vue/test-utils'; import { describe, expect, it } from 'vitest'; import { AppSpan } from '@components/common/span'; describe('标签', () => { expect(AppSpan).toBeTruthy(); it('unitName', async () => { const wrapper = mount(AppSpan, { props: { value: '100', unitName: '元' }, }); expect(wrapper.text()).toContain('100元'); }); it('precision', async () => { const wrapper = mount(AppSpan, { props: { value: 100, dataType: 'INT', precision: 2 }, }); expect(wrapper.text()).toContain('100.00'); }); it('valueFormat', async () => { const wrapper = mount(AppSpan, { props: { value: 9854, valueFormat: "#,###", }, }); expect(wrapper.text()).toContain('9,854'); }); });