From 04026e7bf4b49435da89678b8be992794f090135 Mon Sep 17 00:00:00 2001 From: Jacqueline Zhang Date: Sat, 11 May 2024 15:27:52 +0800 Subject: [PATCH] update tests --- test/license/registerPIL.test.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/test/license/registerPIL.test.ts b/test/license/registerPIL.test.ts index e52b31f..0bebbd8 100644 --- a/test/license/registerPIL.test.ts +++ b/test/license/registerPIL.test.ts @@ -5,6 +5,7 @@ import { expect } from 'chai'; chai.use(chaiAsPromised); import '../setup'; import { registerCommercialRemixPIL, registerCommercialUsePIL, registerNonComSocialRemixingPIL } from '../../utils/sdkUtils'; +import exp from 'constants'; describe("SDK Test", function () { describe("Register PIL", async function () { @@ -83,8 +84,9 @@ describe("SDK Test", function () { it("Register Commercial Use PIL with waitForTransaction: false", async function () { const response = await expect( registerCommercialUsePIL("A", "16", mintingFeeTokenAddress, false) - ).to.not.be.rejected - expect(response.licenseTermsId).to.be.a("string").and.not.empty; + ).to.not.be.rejected; + + expect(response.licenseTermsId || response.txHash).to.be.a("string").and.not.empty; }); }) @@ -138,8 +140,8 @@ describe("SDK Test", function () { let waitForTransaction: any; const response = await expect( registerCommercialRemixPIL("A", "0", 0, mintingFeeTokenAddress, waitForTransaction) - ).to.not.be.rejected - expect(response.licenseTermsId).to.be.a("string").and.not.empty; + ).to.not.be.rejected; + expect(response.licenseTermsId || response.txHash).to.be.a("string").and.not.empty; }); it("Register Commercial Remix PIL with waitForTransaction: true", async function () { @@ -149,12 +151,13 @@ describe("SDK Test", function () { expect(response.licenseTermsId).to.be.a("string").and.not.empty; }); - it("Register Commercial Use PIL with waitForTransaction: false", async function () { + it("Register Commercial Remix PIL with waitForTransaction: false", async function () { const response = await expect( registerCommercialRemixPIL("A", "16", 1001, mintingFeeTokenAddress, false) - ).to.not.be.rejected - expect(response.licenseTermsId).to.be.a("string").and.not.empty; + ).to.not.be.rejected; + + expect(response.licenseTermsId || response.txHash).to.be.a("string").and.not.empty; }); }) }); -}); \ No newline at end of file +});