Add first Contributor contract test
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

This commit is contained in:
Râu Cao 2022-08-24 12:55:50 +01:00
parent d72413eb66
commit 796ccebd84
Signed by: raucao
GPG Key ID: 15E65F399D084BA9
2 changed files with 30 additions and 1 deletions

View File

@ -154,5 +154,4 @@ describe("Contribution contract", async function () {
});
});
});
});

View File

@ -0,0 +1,30 @@
const { expect } = require("chai");
const { ethers, upgrades } = require("hardhat");
// const { anyValue } = require("@nomicfoundation/hardhat-chai-matchers/withArgs");
let owner, addr1, addr2, addr3, addr4, addr5, addr6, addr7;
let Contribution, Contributor;
describe("Contributor contract", async function () {
before(async function () {
[owner, addr1, addr2, addr3, addr4, addr5, addr6, addr7] = await ethers.getSigners();
// let accounts = [owner, addr1, addr2, addr3, addr4, addr5, addr6, addr7];
// const contributorFactory = await ethers.getContractFactory("Contributor");
// Contributor = await upgrades.deployProxy(contributorFactory);
// for (const account of accounts) {
// await Contributor.addContributor(account.address, "0x99b8afd7b266e19990924a8be9099e81054b70c36b20937228a77a5cf75723b8", 18, 32);
// }
});
describe("initialize()", function () {
before(async function () {
// const [owner] = await ethers.getSigners();
const contributorFactory = await ethers.getContractFactory("Contributor");
Contributor = await upgrades.deployProxy(contributorFactory);
});
it("sets the deployer address", async function () {
expect(await Contributor.deployer()).to.equal(owner.address);
expect(await Contributor.deployer()).to.not.equal(addr1.address);
});
});
});