Skip to content

Commit

Permalink
fix(test): resolve PoC testing failures (storyprotocol#80)
Browse files Browse the repository at this point in the history
* fix 3 failures
1. Shall not add IP to group if IP does not share the same licensing terms as the group
2. Dispute - Set tags to the derivative IP assets if the parent infringed
3. Dispute - Set tags to the derivative IP assets if the parent has not infringed
  • Loading branch information
lucas2brh authored and kingster-will committed Jan 31, 2025
1 parent d325d25 commit a8cd35c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions test/hardhat/e2e/dispute/dispute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe("Dispute Flow", function () {
let disputeCounter = await this.disputeModule.disputeCounter();
console.log("disputeCount before", disputeCounter);
await expect(
this.disputeModule.connect(this.user2).tagDerivativeIfParentInfringed(rootIpId, childIpId1, disputeId)
this.disputeModule.connect(this.user2).tagIfRelatedIpInfringed(childIpId1, disputeId)
).not.to.be.rejectedWith(Error).then((tx) => tx.wait());
expect(await this.disputeModule.isIpTagged(childIpId1)).to.be.true;
expect(await this.disputeModule.isIpTagged(childIpId2)).to.be.false;
Expand All @@ -135,7 +135,7 @@ describe("Dispute Flow", function () {

console.log("============ Tag Derivative 2 ============");
await expect(
this.disputeModule.connect(this.user2).tagDerivativeIfParentInfringed(childIpId1, childIpId2, disputeIp1)
this.disputeModule.connect(this.user2).tagIfRelatedIpInfringed(childIpId2, disputeIp1)
).not.to.be.rejectedWith(Error).then((tx) => tx.wait());
expect(await this.disputeModule.isIpTagged(childIpId1)).to.be.true;
expect(await this.disputeModule.isIpTagged(childIpId2)).to.be.true;
Expand Down Expand Up @@ -184,8 +184,8 @@ describe("Dispute Flow", function () {

console.log("============ Tag Derivative ============");
await expect(
this.disputeModule.connect(this.user2).tagDerivativeIfParentInfringed(ipId, childIpId, disputeId)
).to.be.revertedWithCustomError(this.errors, "DisputeModule__ParentNotTagged");
this.disputeModule.connect(this.user2).tagIfRelatedIpInfringed(ipId, disputeId)
).to.be.revertedWithCustomError(this.errors, "DisputeModule__DisputeWithoutInfringementTag");
expect(await this.disputeModule.isIpTagged(childIpId)).to.be.false;
});

Expand Down
2 changes: 1 addition & 1 deletion test/hardhat/e2e/grouping/group.ipa.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ describe("Add IP to group - negative tests", function () {
console.log("============ IP Attach License Config ============");
await expect(
this.licensingModule.connect(this.user1).setLicensingConfig(ipId, PILicenseTemplate, this.commericialRemixLicenseId, LicensingConfig)
).not.to.be.rejectedWith(Error).then((tx) => tx.wait());
).to.be.revertedWithCustomError(this.errors, "LicensingModule__LicensingConfigMintingFeeBelowLicenseTerms");

console.log("============ Add IP to group ============");
await expect(
Expand Down
2 changes: 1 addition & 1 deletion test/hardhat/e2e/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ before(async function () {
this.arbitrationPolicyUMA = await hre.ethers.getContractAt("ArbitrationPolicyUMA", ArbitrationPolicyUMA);
this.coreMetadataModule = await hre.ethers.getContractAt("CoreMetadataModule", CoreMetadataModule);
this.CoreMetadataViewModule = await hre.ethers.getContractAt("CoreMetadataViewModule", CoreMetadataViewModule);
this.errors = await hre.ethers.getContractFactory("Errors");
this.errors = await hre.ethers.getContractFactory("contracts/lib/Errors.sol:Errors");

console.log(`================= Load Users =================`);
[this.owner, this.user1, this.user2] = await hre.ethers.getSigners();
Expand Down

0 comments on commit a8cd35c

Please sign in to comment.