调整结构
This commit is contained in:
14
frontend/src/utils/user.test.ts
Normal file
14
frontend/src/utils/user.test.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { formatDate, initials } from './user'
|
||||
|
||||
describe('用户展示工具', () => {
|
||||
it('可以生成姓名缩写', () => {
|
||||
expect(initials('Lin Chen')).toBe('LC')
|
||||
expect(initials('晓晨')).toBe('晓晨')
|
||||
})
|
||||
|
||||
it('可以格式化日期', () => {
|
||||
expect(formatDate('2025-01-02T00:00:00Z')).toContain('2025')
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user