- 在用户删除后获取用户信息的测试中添加Authorization头 - 确保删除接口正确处理已认证用户的权限验证场景
@@ -384,6 +384,10 @@ describe('用户路由API集成测试 (使用hono/testing)', () => {
// 验证再次获取用户返回404
const getResponse = await client[':id'].$get({
param: { id: testUser.id }
+ }, {
+ headers: {
+ 'Authorization': `Bearer ${testToken}`
+ }
});
IntegrationTestAssertions.expectStatus(getResponse, 404);