fix lint and type error

This commit is contained in:
2026-03-18 20:08:04 +08:00
parent 58e1c34b69
commit 1040e3ecfd
9 changed files with 67 additions and 38 deletions
@@ -137,7 +137,7 @@ describe('useUserManageStore', () => {
it('sets loading to false and shows error message on failure', async () => {
const { api } = await import('@/utils/request')
vi.mocked(api.get).mockRejectedValueOnce(new Error('Network error'))
const errorSpy = vi.spyOn(message, 'error').mockImplementation(() => ({}) as any)
const errorSpy = vi.spyOn(message, 'error').mockImplementation(() => ({}) as never)
const store = useUserManageStore()
await store.fetchUsers()
@@ -175,7 +175,7 @@ describe('UserFormModal', () => {
// 验证 PUT payload 包含 status 且不包含 ext
expect(api.put).toHaveBeenCalledOnce()
const [url, payload] = vi.mocked(api.put).mock.calls[0]
const [url, payload] = vi.mocked(api.put).mock.calls[0]!
expect(url).toContain('/api/v1/users/')
expect(payload).toHaveProperty('status')
expect(payload).not.toHaveProperty('ext')