From 4469f49989c775eaa6cd48d6d06d19ab4b9c0c46 Mon Sep 17 00:00:00 2001 From: Jacqueline Zhang <131138188+jacqueline-57b@users.noreply.github.com> Date: Fri, 21 Jun 2024 17:25:03 +0800 Subject: [PATCH] update tests (#5) --- test/e2e/licenseTerms.comUsePIL.test.ts | 36 ---------------- test/nftClient/createNFTCollection.test.ts | 48 +--------------------- 2 files changed, 2 insertions(+), 82 deletions(-) delete mode 100644 test/e2e/licenseTerms.comUsePIL.test.ts diff --git a/test/e2e/licenseTerms.comUsePIL.test.ts b/test/e2e/licenseTerms.comUsePIL.test.ts deleted file mode 100644 index 732cb11..0000000 --- a/test/e2e/licenseTerms.comUsePIL.test.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { privateKeyA, privateKeyB } from '../../config/config'; -import { attachLicenseTerms } from '../../utils/sdkUtils'; -import { expect } from 'chai' -import chai from 'chai'; -import chaiAsPromised from 'chai-as-promised'; -chai.use(chaiAsPromised); -import '../setup'; -import { Address } from 'viem'; -import { comUseLicenseTermsId1, comUseLicenseTermsId2 } from '../setup'; -import addContext from 'mochawesome/addContext'; -import { mintNFTAndRegisterDerivative, mintNFTCreateRootIPandAttachPIL } from '../testUtils'; - -let ipIdA: Address; -let ipIdB: Address; - -describe('SDK E2E Test', function () { - describe(`Commercial Use PIL: "derivativesReciprocal":false`, async function () { - before("Register parent and derivative IP assets", async function () { - addContext(this, "licenseTermsId:" + comUseLicenseTermsId1); - - // root IP: ipIdA - ipIdA = await mintNFTCreateRootIPandAttachPIL("A", privateKeyA, comUseLicenseTermsId1); - addContext(this, "Root IP - ipIdA:" + ipIdA); - // ipIdB is ipIdA's derivative IP - ipIdB = await mintNFTAndRegisterDerivative("B", privateKeyB, [ipIdA], [comUseLicenseTermsId1]); - addContext(this, "ipIdA's derivative IP - ipIdB:" + ipIdB); - }); - - step(`"derivativesReciprocal":false, derivative IP (ipIdB) can attach addtional license terms`, async function () { - // const response = await expect( - const response = await - attachLicenseTerms("B", ipIdB, comUseLicenseTermsId2, true) - // ).to.not.be.rejected; - }); - }); -}); diff --git a/test/nftClient/createNFTCollection.test.ts b/test/nftClient/createNFTCollection.test.ts index e1ea9af..c89a6ef 100644 --- a/test/nftClient/createNFTCollection.test.ts +++ b/test/nftClient/createNFTCollection.test.ts @@ -6,7 +6,7 @@ import '../setup'; import { createNFTCollection } from '../../utils/sdkUtils'; import { accountA, mintingFeeTokenAddress } from '../../config/config'; -describe("SDK Test", function () { +describe.only("SDK Test", function () { describe("Create NFT Collection - nftClient.createNFTCollection", async function () { it("Create NFT collection", async function () { const response = await expect( @@ -59,21 +59,7 @@ describe("SDK Test", function () { expect(response.txHash).to.be.a("string").and.not.empty; expect(response.nftContract).to.be.a("string").and.not.empty; - }); - - it.skip("Create NFT collection with mintCost and invalid mintToken", async function () { - let mintToken: any; - const options = { - maxSupply: 10n, - mintCost: 1, - mintToken: mintToken, - owner: accountA.address - }; - - const response = await expect( - createNFTCollection("A", "sdk-e2e-test", "test", true, options) - ).to.be.rejectedWith("Failed to create a SPG NFT collection: Invalid mint token address, mint cost is greater than 0."); - }); + }); it("Create NFT collection with multi undefined parameters", async function () { let maxSupply: any; @@ -106,36 +92,6 @@ describe("SDK Test", function () { ).to.be.rejectedWith("Failed to create a SPG NFT collection: Cannot convert test to a BigInt"); }); - it.skip("Create NFT collection with invalid type for mintCost", async function () { - const options = { - mintCost: "test" - }; - - const response = await expect( - createNFTCollection("A", "sdk-e2e-test", "test", true, options) - ).to.be.rejectedWith("Failed to create a SPG NFT collection: Cannot convert test to a BigInt"); - }); - - it.skip("Create NFT collection with invalid type for mintToken", async function () { - const options = { - mintToken: "test" - }; - - const response = await expect( - createNFTCollection("A", "sdk-e2e-test", "test", true, options) - ).to.be.rejectedWith("Failed to create a SPG NFT collection: Address \"test\" is invalid."); - }); - - it.skip("Create NFT collection with mintToken: 0x0000", async function () { - const options = { - mintToken: "0x0000" - }; - - const response = await expect( - createNFTCollection("A", "sdk-e2e-test", "test", true, options) - ).to.be.rejectedWith("Failed to create a SPG NFT collection: Address \"0x0000\" is invalid."); - }); - it("Create NFT collection with invalid type for owner", async function () { const options = { owner: "test"