update at 2026-01-22 18:43:01
This commit is contained in:
25
tests/centerIcon.test.ts
Normal file
25
tests/centerIcon.test.ts
Normal 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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user