Skip to content

Commit

Permalink
Adds pledgerCount tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesduncombe committed Apr 22, 2024
1 parent eb7b6d3 commit a25d363
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/fast/Crowdfund.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,26 @@ describe("Crowdfunds", () => {
});
});

describe("pledgerCount", () => {
it("returns the number of pledgers", async () => {
await deployCrowdfund(validParams);

// Provision ERC20 token for bob and alice.
for (const user of [alice, bob]) {
erc20.allowance.returns(1_000_000_000);
erc20.transferFrom.returns(true);
}

await crowdfundAsIssuer.advanceToFunding(20_00);
// Pledge 1000 tokens from bob and alice.
await Promise.all(
[alice, bob].map((user) => crowdfund.connect(user).pledge(500))
);
const subject = await crowdfund.pledgerCount();
expect(subject).to.eq(2);
});
});

describe("advanceToFunding", () => {
describe("from an invalid phase", () => {
it("reverts", async () => {
Expand Down

0 comments on commit a25d363

Please sign in to comment.