diff --git a/test/myModule.test.ts b/test/myModule.test.ts index 9d80b37..4dbbde1 100644 --- a/test/myModule.test.ts +++ b/test/myModule.test.ts @@ -2,25 +2,25 @@ import { expect } from "chai" import { ethers, deployments, getNamedAccounts } from "hardhat" const setup = async () => { - await deployments.fixture(["MyModule"]) + await deployments.fixture(["moduleProxy"]) const { tester } = await getNamedAccounts() const testSigner = await ethers.getSigner(tester) const buttonDeployment = await deployments.get("Button") - const myModuleDeployment = await deployments.get("MyModule") + const myModuleProxyDeployment = await deployments.get("MyModuleProxy") const buttonContract = await ethers.getContractAt("Button", buttonDeployment.address, testSigner) - const myModuleContract = await ethers.getContractAt("MyModule", myModuleDeployment.address, testSigner) - return { buttonContract, myModuleContract } + const myModuleProxyContract = await ethers.getContractAt("MyModule", myModuleProxyDeployment.address, testSigner) + return { buttonContract, myModuleProxyContract } } describe("MyModule", function () { it("Should be possible to 'press the button' through MyModule", async function () { - const { buttonContract, myModuleContract } = await setup() + const { buttonContract, myModuleProxyContract } = await setup() expect(await buttonContract.pushes()).to.equal(0) - await myModuleContract.pushButton() + await myModuleProxyContract.pushButton() expect(await buttonContract.pushes()).to.equal(1) }) it("Should NOT be possible to 'press the button' directly on the Button contract", async function () { const { buttonContract } = await setup() - expect(buttonContract.pushButton()).to.revertedWith("Ownable: caller is not the owner") + await expect(buttonContract.pushButton()).to.revertedWith("Ownable: caller is not the owner") }) })