fix claim validation and expert branch scoping

This commit is contained in:
SepehrYahyaee
2026-09-20 15:00:46 +03:30
parent 4ef53f2cc9
commit e06178f804
13 changed files with 640 additions and 29 deletions

View File

@@ -38,6 +38,9 @@ describe("RequestManagementService FileReviewer inbox", () => {
(service as any).claimCaseDbService = {
find: jest.fn().mockResolvedValue([]),
};
(service as any).fanavaranLocationService = {
assertMakerReviewerBranchCompatible: jest.fn().mockResolvedValue(undefined),
};
return { service, blameRequestDbService };
}
@@ -89,6 +92,22 @@ describe("RequestManagementService FileReviewer inbox", () => {
expect(result.list).toEqual([]);
});
it("does not list an open file from another branch", async () => {
const { service } = createService([sealedFile]);
(service as any).fanavaranLocationService
.assertMakerReviewerBranchCompatible.mockRejectedValue(
new Error("This file belongs to another branch."),
);
const result = await service.getMyFileReviewerFiles({
sub: String(reviewerId),
role: RoleEnum.FILE_REVIEWER,
clientKey: String(clientId),
});
expect(result.list).toEqual([]);
});
it("sorts and paginates the reviewer inbox with the shared list contract", async () => {
const olderFile = {
...sealedFile,