Skip to content

Commit

Permalink
Update test code as NFTContractURIdentifiable contract is updated
Browse files Browse the repository at this point in the history
  • Loading branch information
TheGreatHB committed Nov 6, 2021
1 parent 7529d82 commit f53ad88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
9 changes: 9 additions & 0 deletions test/NFT1155.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,15 @@ describe("NFT part of NFT1155", () => {
expect(await nft1155_0.uri(2)).to.be.not.equal(await URI1155(nft1155_0, 2));
expect(await nft1155_0.uri(4)).to.be.not.equal(await URI1155(nft1155_0, 4));
expect(await nft1155_0.uri(7)).to.be.not.equal(await URI1155(nft1155_0, 7));

expect(await nft1155_0.contractURI()).to.be.equal(`https://foo.bar/${nft1155_0.address.toLowerCase()}.json`);
await expect(nft1155_0.connect(bob).setContractURI("https://foo.bar/contractUri/")).to.be.revertedWith("SHOYU: FORBIDDEN");
await nft1155_0.connect(alice).setContractURI("https://foo.bar/contractUri/");
expect(await nft1155_0.contractURI()).to.be.equal("https://foo.bar/contractUri/");

await factory.deployNFT1155AndMintBatch(alice.address, [10], [3], royaltyVault.address, 10);
const nft1155_1 = await getNFT1155(factory);
expect(await nft1155_1.contractURI()).to.be.equal(`https://nft1155.sushi.com/${nft1155_1.address.toLowerCase()}.json`);
});

it("should be that mint/mintBatch functions work well", async () => {
Expand Down
10 changes: 10 additions & 0 deletions test/NFT721.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ describe("NFT part of NFT721", () => {
expect(await nft721_0.tokenURI(2)).to.be.not.equal(await URI721(nft721_0, 2));
expect(await nft721_0.tokenURI(4)).to.be.not.equal(await URI721(nft721_0, 4));
expect(await nft721_0.tokenURI(7)).to.be.not.equal(await URI721(nft721_0, 7));

expect(await nft721_0.contractURI()).to.be.equal(`https://foo.bar/${nft721_0.address.toLowerCase()}.json`);
await expect(nft721_0.connect(bob).setContractURI("https://foo.bar/contractUri/")).to.be.revertedWith("SHOYU: FORBIDDEN");
await nft721_0.connect(alice).setContractURI("https://foo.bar/contractUri/");
expect(await nft721_0.contractURI()).to.be.equal("https://foo.bar/contractUri/");

await factory.deployNFT721AndPark(alice.address, "Name", "Symbol", 10, royaltyVault.address, 10);
const nft721_1 = await getNFT721(factory);
expect(await nft721_1.contractURI()).to.be.equal(`https://nft721.sushi.com/${nft721_1.address.toLowerCase()}.json`);

});

it("should be that parkTokenIds func work well", async () => {
Expand Down

0 comments on commit f53ad88

Please sign in to comment.