|
|
@@ -36,8 +36,12 @@ describe('File API Integration Tests', () => {
|
|
|
vi.clearAllMocks();
|
|
|
|
|
|
// Mock auth middleware to bypass authentication
|
|
|
- vi.mocked(authMiddleware).mockImplementation(async (_, next) => {
|
|
|
- _.set('user', user1)
|
|
|
+ vi.mocked(authMiddleware).mockImplementation(async (c, next) => {
|
|
|
+ const authHeader = c.req.header('Authorization');
|
|
|
+ if (!authHeader) {
|
|
|
+ return c.json({ message: 'Authorization header missing' }, 401);
|
|
|
+ }
|
|
|
+ c.set('user', user1)
|
|
|
await next();
|
|
|
});
|
|
|
|
|
|
@@ -120,7 +124,7 @@ describe('File API Integration Tests', () => {
|
|
|
};
|
|
|
|
|
|
const response = await client.files['upload-policy'].$post({
|
|
|
- json: invalidData
|
|
|
+ json: invalidData as any
|
|
|
},
|
|
|
{
|
|
|
headers: {
|