forked from Yara724/api
Enforce claim beneficiary access and retire unused legacy APIs
This commit is contained in:
@@ -39,7 +39,9 @@ describe("RequestManagementService FileReviewer inbox", () => {
|
||||
find: jest.fn().mockResolvedValue([]),
|
||||
};
|
||||
(service as any).fanavaranLocationService = {
|
||||
assertMakerReviewerBranchCompatible: jest.fn().mockResolvedValue(undefined),
|
||||
assertMakerReviewerBranchCompatible: jest
|
||||
.fn()
|
||||
.mockResolvedValue(undefined),
|
||||
};
|
||||
return { service, blameRequestDbService };
|
||||
}
|
||||
@@ -94,10 +96,11 @@ describe("RequestManagementService FileReviewer inbox", () => {
|
||||
|
||||
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."),
|
||||
);
|
||||
(
|
||||
service as any
|
||||
).fanavaranLocationService.assertMakerReviewerBranchCompatible.mockRejectedValue(
|
||||
new Error("This file belongs to another branch."),
|
||||
);
|
||||
|
||||
const result = await service.getMyFileReviewerFiles({
|
||||
sub: String(reviewerId),
|
||||
@@ -137,10 +140,12 @@ describe("RequestManagementService FileReviewer inbox", () => {
|
||||
|
||||
it("does not expose an open file's details to a reviewer from another tenant", async () => {
|
||||
const { service } = createService([]);
|
||||
(service as any).blameRequestDbService.findById = jest.fn().mockResolvedValue({
|
||||
...sealedFile,
|
||||
parties: [{ role: "FIRST", person: { clientId: otherClientId } }],
|
||||
});
|
||||
(service as any).blameRequestDbService.findById = jest
|
||||
.fn()
|
||||
.mockResolvedValue({
|
||||
...sealedFile,
|
||||
parties: [{ role: "FIRST", person: { clientId: otherClientId } }],
|
||||
});
|
||||
|
||||
await expect(
|
||||
service.getMyFileReviewerFileDetail(
|
||||
@@ -225,16 +230,11 @@ describe("RequestManagementService FileReviewer inbox", () => {
|
||||
}),
|
||||
findOneAndUpdate: jest.fn(),
|
||||
};
|
||||
const expertClaimService = new (ExpertClaimService as any)(
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
blameRequestDbService,
|
||||
const expertClaimService = Object.assign(
|
||||
Object.create(ExpertClaimService.prototype),
|
||||
{
|
||||
blameRequestDbService,
|
||||
},
|
||||
) as ExpertClaimService;
|
||||
|
||||
await expect(
|
||||
|
||||
Reference in New Issue
Block a user