-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsample-test.js
21 lines (20 loc) · 977 Bytes
/
sample-test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { expect } = require("chai");
const { ethers } = require("hardhat");
describe("dMarket Contract Test", () => {
it("Should return Token Name and Symbol", async () => {
const contract = await ethers.getContractFactory("dMarket");
const dmarketContract = await contract.deploy();
await dmarketContract.deployed();
expect(await dmarketContract.symbol()).to.equal("DMKT");
expect(await dmarketContract.name()).to.equal("dMarket");
});
it('Should create NFT and return correct token URI', async () => {
const contract = await ethers.getContractFactory("dMarket");
const dmarketContract = await contract.deploy();
await dmarketContract.deployed();
const createNFTtx = await dmarketContract.createNFT('https://echo.test', '150000', { value: ethers.utils.parseEther('0.01') });
// wait until the transaction is mined
await createNFTtx.wait();
expect(await dmarketContract.tokenURI(1)).to.equal("https://echo.test");
})
});