forked from Yara724/api
fix claim validation and expert branch scoping
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user