-
-
Save piorot/0af9c0268b5376672a3ee21e83d93e05 to your computer and use it in GitHub Desktop.
It should not be possible to withdraw more than one should
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("It should not be possible to withdraw more than one should", async () => { | |
const Apartment = await ethers.getContractFactory("Apartment"); | |
const apartment = await Apartment.deploy(); | |
[owner, Alice, Bob] = await ethers.getSigners(); | |
await apartment.deployed(); | |
await apartment.transfer(Alice.address, 20); | |
await Bob.sendTransaction({ | |
to: apartment.address, | |
value: ethers.utils.parseEther("1") | |
}); | |
await apartment.connect(Alice).withdraw(); | |
await expect(apartment.connect(Alice).withdraw()).to.be.revertedWith("0 funds to withdraw"); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment