import { describe, it, expect } from 'vitest'; import { loadCenterIcon } from '../src/centerIcon'; describe('centerIcon', () => { it('应生成带默认旋转的中心图标数据', async () => { const data = await loadCenterIcon({ rIcon: 50, opacity: 0.8, name: 'centericon.svg', }); expect(data.rotation).toBe(0); expect(data.svgPath).toBe('src/assets/icons/centericon.svg'); }); it('应支持自定义图标路径', async () => { const data = await loadCenterIcon( { rIcon: 20, opacity: 1, name: 'icon.svg', rotation: 30 }, '/icons' ); expect(data.svgPath).toBe('/icons/icon.svg'); expect(data.rotation).toBe(30); }); });