Untitled

                Never    
Text
       
const { expect } = require("chai");
const { ethers } = require("hardhat");

describe("Testing NFT", function () {
    let nftContract;

    it("Deployment Testing", async function () {
        const [owner] = await ethers.getSigners();

        const NFT = await ethers.getContractFactory("NFT");
        nftContract = await NFT.deploy();

        expect(nftContract.runner.addres).to.equal(owner.addres)
    })

    it("Should get name", async function () {
        expect(await nftContract.name()).to.equal("HashTag");
    })

    it("Should Mint NFT", async function () {
        await expect(nftContract.MintNFT("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"))
            .to.emit(nftContract, "Transfer")
            .withArgs("0x0000000000000000000000000000000000000000", "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266", 1)
    })

    it("Check owner",async function() {
        const nftOwner = await nftContract.ownerOf(1);

        expect(nftOwner).to.equal("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266");
    })

    it("Should revert", async function() {
        const [owner, otherAc] = await ethers.getSigners();

        await expect(nftContract.connect(otherAc).changeTokenURI("other URI")).to.be.revertedWith("You're not authorized")
    })
})

Raw Text