Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacqueline Zhang committed May 11, 2024
1 parent 6fc99fd commit 04026e7
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions test/license/registerPIL.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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;
});
})

Expand Down Expand Up @@ -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 () {
Expand All @@ -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;
});
})
});
});
});

0 comments on commit 04026e7

Please sign in to comment.