Files
backend/src/modules/investments/operations/presentation/brokerage-operations.controller.spec.ts
T
ksv741 afdb6b15fd
Backend verify / commits (pull_request) Successful in 1m28s
Backend verify / security (pull_request) Successful in 1m7s
Backend verify / verify (pull_request) Successful in 6m6s
refactor: replace deep imports with native node aliases (WealthLedger/backend#165)
2026-11-04 22:58:36 +03:00

19 lines
680 B
TypeScript

jest.mock('#src/prisma/prisma.service', () => ({
PrismaService: class PrismaService {},
}));
import { BrokerageOperationsController } from './brokerage-operations.controller';
describe('BrokerageOperationsController', () => {
it('passes the authenticated user, account, and validated query to the service', async () => {
const operations = { read: jest.fn() };
const controller = new BrokerageOperationsController(operations as never);
const query = { limit: 10 };
const request = { user: { sub: 'user' } };
await controller.get(request as never, 'account', query);
expect(operations.read).toHaveBeenCalledWith('user', 'account', query);
});
});