Skip to content

Commit

Permalink
fix: update test to make ci green
Browse files Browse the repository at this point in the history
  • Loading branch information
0xjei committed Mar 10, 2023
1 parent bff0567 commit 9b43243
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/actions/test/data/generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@ export const generateFakeContribution = (
verificationSoftware: fakeData.data.verificationSoftware,
valid: fakeData.data.valid,
lastUpdated: fakeData.data.lastUpdated,
beacon: fakeData.data.beacon
beacon: !fakeData.data.beacon ? undefined : fakeData.data.beacon
}
})
5 changes: 3 additions & 2 deletions packages/actions/test/e2e/03-finalization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ describe("Finalization e2e", () => {
const result = await checkAndPrepareCoordinatorForFinalization(userFunctions, ceremonyClosed.uid)
expect(result).to.be.true
// call the function
await expect(finalizeCircuit(userFunctions, ceremonyClosed.uid, finalizizationCircuit.uid, bucketName)).to
.be.fulfilled
await expect(
finalizeCircuit(userFunctions, ceremonyClosed.uid, finalizizationCircuit.uid, bucketName, `handle-id`)
).to.be.fulfilled

await expect(finalizeCeremony(userFunctions, ceremonyClosed.uid)).to.be.fulfilled

Expand Down
6 changes: 6 additions & 0 deletions packages/actions/test/unit/contribute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,12 @@ describe("Contribute", () => {
fakeCeremoniesData.fakeCeremonyOpenedDynamic,
fakeCircuitsData.fakeCircuitSmallContributors
)

// @todo need rework.
// delete when undefined.
if (!fakeContributions.fakeContributionDone.data.beacon)
delete fakeContributions.fakeContributionDone.data.beacon

// user2 -> users[1]
await createMockContribution(
adminFirestore,
Expand Down
18 changes: 12 additions & 6 deletions packages/actions/test/unit/finalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ describe("Finalize", () => {
userFunctions,
fakeCeremoniesData.fakeCeremonyClosedDynamic.uid,
fakeCircuitsData.fakeCircuitSmallContributors.uid,
bucketName
bucketName,
`handle-id`
)
).to.be.rejectedWith("You do not have privileges to perform this operation.")
})
Expand All @@ -272,7 +273,8 @@ describe("Finalize", () => {
userFunctions,
fakeCeremoniesData.fakeCeremonyClosedDynamic.uid,
fakeCircuitsData.fakeCircuitSmallContributors.uid,
bucketName
bucketName,
`handle-id`
)
).to.be.rejectedWith("You do not have privileges to perform this operation.")
})
Expand All @@ -283,7 +285,8 @@ describe("Finalize", () => {
userFunctions,
"invalid",
fakeCircuitsData.fakeCircuitSmallContributors.uid,
bucketName
bucketName,
`handle-id`
)
).to.be.rejectedWith(
"Unable to find a document with the given identifier for the provided collection path."
Expand All @@ -295,7 +298,8 @@ describe("Finalize", () => {
userFunctions,
fakeCeremoniesData.fakeCeremonyClosedDynamic.uid,
"invalid",
bucketName
bucketName,
`handle-id`
)
).to.be.rejectedWith(
"Unable to find a document with the given identifier for the provided collection path."
Expand All @@ -307,7 +311,8 @@ describe("Finalize", () => {
userFunctions,
fakeCeremoniesData.fakeCeremonyClosedDynamic.uid,
fakeCircuitsData.fakeCircuitSmallContributors.uid,
"invalidBucketName"
"invalidBucketName",
`handle-id`
)
).to.be.rejectedWith("Unable to download the AWS S3 object from the provided ceremony bucket.")
})
Expand All @@ -325,7 +330,8 @@ describe("Finalize", () => {
userFunctions,
fakeCeremoniesData.fakeCeremonyClosedDynamic.uid,
fakeCircuitsData.fakeCircuitSmallContributors.uid,
bucketName
bucketName,
`handle-id`
)
).to.be.fulfilled
})
Expand Down

0 comments on commit 9b43243

Please sign in to comment.