Skip to content

Commit

Permalink
Fixing tests and adding comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ecamellini committed Nov 19, 2024
1 parent 6e3b3d9 commit 1540245
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ describe("approve producer delegation", () => {
payload: event.data,
});

const expectedContractFilePath = (
const actualConractPath = (
await fileManager.listFiles(config.s3Bucket, genericLogger)
)[0];

const documentId = unsafeBrandId<DelegationContractId>(
expectedContractFilePath.split("/")[2]
actualConractPath.split("/")[2]
);

const approvedDelegationWithoutContract: Delegation = {
Expand All @@ -123,15 +123,15 @@ describe("approve producer delegation", () => {
name: `${formatDateyyyyMMddHHmmss(
currentExecutionTime
)}_delegation_activation_contract.pdf`,
path: expectedContractFilePath,
path: actualConractPath,
prettyName: "Delega",
},
});
expect(actualDelegation).toEqual(expectedDelegation);

const actualContract = await fileManager.get(
config.s3Bucket,
expectedContractFilePath,
actualConractPath,
genericLogger
);

Expand All @@ -153,6 +153,7 @@ describe("approve producer delegation", () => {
genericLogger
);

// TODO fix this, it's not really working
expect(flushPDFMetadata(actualContract, currentExecutionTime)).toEqual(
flushPDFMetadata(expectedContract, currentExecutionTime)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ describe("revoke producer delegation", () => {
payload: event.data,
});

const expectedContractFilePath = (
const actualContractPath = (
await fileManager.listFiles(config.s3Bucket, genericLogger)
)[0];

const documentId = unsafeBrandId<DelegationContractId>(
expectedContractFilePath.split("/")[2]
actualContractPath.split("/")[2]
);

const revokedDelegationWithoutContract: Delegation = {
Expand All @@ -209,15 +209,15 @@ describe("revoke producer delegation", () => {
name: `${formatDateyyyyMMddHHmmss(
currentExecutionTime
)}_delegation_revocation_contract.pdf`,
path: expectedContractFilePath,
path: actualContractPath,
prettyName: "Revoca della delega",
},
});
expect(actualDelegation).toEqual(expectedDelegation);

const actualContract = await fileManager.get(
config.s3Bucket,
expectedContractFilePath,
actualContractPath,
genericLogger
);

Expand All @@ -239,6 +239,7 @@ describe("revoke producer delegation", () => {
genericLogger
);

// TODO fix this, it's not really working
expect(flushPDFMetadata(actualContract, currentExecutionTime)).toEqual(
flushPDFMetadata(expectedContract, currentExecutionTime)
);
Expand Down

0 comments on commit 1540245

Please sign in to comment.