Skip to content

Commit 097e77d

Browse files
author
Beau Shinkle
committed
Make operatorsInPool test multiple operator counts
Previously an implementation like `return 1` passed the test :)
1 parent 147d8a1 commit 097e77d

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

test/sortitionTreeTest.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,12 +286,14 @@ describe("SortitionTree", () => {
286286
})
287287

288288
describe("operatorsInPool", async () => {
289-
context("when the operator is in the pool", () => {
290-
it("should return true", async () => {
291-
await sortition.publicInsertOperator(alice.address, 1)
292-
const nOperators = await sortition.operatorsInPool()
293-
expect(nOperators).to.be.equal(1)
294-
})
289+
it("counts the number of operators in the pool", async () => {
290+
await sortition.publicInsertOperator(alice.address, 1)
291+
const justAlice = await sortition.operatorsInPool()
292+
expect(justAlice).to.be.equal(1)
293+
294+
await sortition.publicInsertOperator(bob.address, 1)
295+
const aliceAndBob = await sortition.operatorsInPool()
296+
expect(aliceAndBob).to.be.equal(2)
295297
})
296298
})
297299

0 commit comments

Comments
 (0)