update at 2026-01-22 18:43:01

This commit is contained in:
douboer
2026-01-22 18:43:01 +08:00
parent c23c71eabf
commit a930a99a50
23 changed files with 2082 additions and 1186 deletions

25
tests/centerIcon.test.ts Normal file
View File

@@ -0,0 +1,25 @@
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);
});
});