Skip to content

Commit e6d6b68

Browse files
authored
Merge pull request #1247 from kodustech/feat/public-pr-review-demo
feat(try): public PR review demo (apps/try + /cli/public/* API)
2 parents ce40fea + 4a34085 commit e6d6b68

82 files changed

Lines changed: 11934 additions & 298 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/api/src/controllers/__tests__/cli-review.controller.session-events.spec.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jest.mock(
2222

2323
import { UnauthorizedException } from '@nestjs/common';
2424
import { CliReviewController } from '../cli/cli-review.controller';
25+
import { ValidateCliKeyUseCase } from '@libs/cli-review/application/use-cases/validate-cli-key.use-case';
2526

2627
describe('CliReviewController.ingestSessionEvent', () => {
2728
let controller: CliReviewController;
@@ -47,6 +48,18 @@ describe('CliReviewController.ingestSessionEvent', () => {
4748
.mockResolvedValue({ allowed: true, remaining: 999 }),
4849
};
4950

51+
// Construct the real use case against the same mocked services
52+
// so the auth flow inside ingestSessionEvent still resolves
53+
// through `teamCliKeyService.validateKey` like before.
54+
const validateCliKeyUseCase = new ValidateCliKeyUseCase(
55+
teamCliKeyService as any,
56+
{} as any, // teamService — JWT path not exercised here
57+
{} as any, // authService
58+
{} as any, // cliDeviceService
59+
{} as any, // jwtService
60+
{ get: () => ({ secret: 'test' }) } as any,
61+
);
62+
5063
controller = new CliReviewController(
5164
{} as any, // executeCliReviewUseCase
5265
{ execute: jest.fn() } as any, // enqueueCliReviewUseCase
@@ -56,6 +69,11 @@ describe('CliReviewController.ingestSessionEvent', () => {
5669
{} as any, // submitCliSessionCaptureUseCase
5770
{} as any, // trialRateLimiter
5871
authenticatedRateLimiter as any, // authenticatedRateLimiter
72+
{} as any, // githubPublicPrService
73+
{} as any, // publicPrReviewUseCase
74+
{} as any, // listFeaturedPublicReviewsUseCase
75+
{} as any, // getFeaturedPublicReviewUseCase
76+
validateCliKeyUseCase as any, // validateCliKeyUseCase
5977
teamCliKeyService as any, // teamCliKeyService
6078
{} as any, // teamService
6179
{} as any, // authService

0 commit comments

Comments
 (0)