refactor: organize backend by business responsibility
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
jest.mock('../../../../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 = { get: 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.get).toHaveBeenCalledWith('user', 'account', query);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user