refactor: organize backend by business responsibility
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
jest.mock('../../../prisma/prisma.service', () => ({
|
||||
PrismaService: class PrismaService {},
|
||||
}));
|
||||
|
||||
import { UpcomingEventsController } from './upcoming-events.controller';
|
||||
|
||||
describe('UpcomingEventsController', () => {
|
||||
it('passes the authenticated user and account to the service', async () => {
|
||||
const events = { get: jest.fn() };
|
||||
const controller = new UpcomingEventsController(events as never);
|
||||
await controller.get({ user: { sub: 'user' } } as never, 'account', {
|
||||
from: '2026-09-01',
|
||||
to: '2026-09-30',
|
||||
});
|
||||
expect(events.get).toHaveBeenCalledWith('user', 'account', {
|
||||
from: '2026-09-01',
|
||||
to: '2026-09-30',
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user