I am having a really hard time writing hardhat test for ERC721 Upgradeable contract.
Here's my test code.
describe('BoxNFT', function () {
it('check the owner', async function () {
const contractFactory = await ethers.getContractFactory('BoxNFT')
const [owner] = await ethers.getSigners()
const contract = await contractFactory.deploy()
expect(await contract.owner()).to.equal(owner.address)
}
}
And here's my contract.
contract BoxNFT is ERC721Upgradeable, OwnableUpgradeable, ReentrancyGuardUpgradeable {
function initialize() public initializer {
OwnableUpgradeable.__Ownable_init();
ReentrancyGuardUpgradeable.__ReentrancyGuard_init();
ERC721Upgradeable.__ERC721_init("Box NFT", "BoxNFT");
}
}
When I run the test code, I have this error.
AssertionError: expected '0x0000000000000000000000000000000000000000' to equal '0xf39Fd6e51aad88F6F4ce6aB88272*************'
+ expected - actual
-0x0000000000000000000000000000000000000000
+0xf39Fd6e51aad88F6F4ce6aB88272*************
What's wrong there?
Why the owner is 0x0000000000000000000000000000000000000000 instead of 0xf39Fd6e51aad88F6F4ce6aB88272*************?
