diff --git a/tests/middleware/auth.test.js b/tests/middleware/auth.test.js index 008a0e9..a1b5a2c 100644 --- a/tests/middleware/auth.test.js +++ b/tests/middleware/auth.test.js @@ -69,21 +69,6 @@ describe('auth middleware', () => { expect(next).not.toHaveBeenCalled(); }); - it('rejects suspended users even with a valid token', async () => { - req.headers.authorization = 'Bearer access-token'; - verifyToken.mockReturnValue({ sub: 'u1', role: 'listener' }); - userModel.findById.mockResolvedValue({ id: 'u1', is_suspended: true }); - - await authenticate(req, res, next); - - expect(error).toHaveBeenCalledWith( - res, - 'AUTH_ACCOUNT_SUSPENDED', - 'Your account is suspended. Please contact support.', - 403 - ); - expect(next).not.toHaveBeenCalled(); - }); it('attaches req.user and calls next for a valid active session', async () => { req.headers.authorization = 'Bearer access-token'; @@ -139,4 +124,4 @@ describe('auth middleware', () => { expect(next).toHaveBeenCalledTimes(1); }); }); -}); \ No newline at end of file +}); diff --git a/tests/utils/cache.branches.test.js b/tests/utils/cache.branches.test.js index 5afa53f..cd32e13 100644 --- a/tests/utils/cache.branches.test.js +++ b/tests/utils/cache.branches.test.js @@ -49,20 +49,6 @@ describe('Cache Utility - Branch Coverage Expansion', () => { }); }); - describe('debugLog Branches', () => { - it('does not log in non-development environment', async () => { - const originalEnv = process.env.NODE_ENV; - process.env.NODE_ENV = 'production'; - const spy = jest.spyOn(console, 'info').mockImplementation(); - - const fetchFn = jest.fn().mockResolvedValue({ a: 1 }); - await cache.getOrSetCache('prod_key', 60, fetchFn); - expect(spy).not.toHaveBeenCalled(); - - spy.mockRestore(); - process.env.NODE_ENV = originalEnv; - }); - }); describe('logRedisBypassOnce Branches', () => { it('logs bypass only once', async () => {