Skip to content

Commit 85c7ca5

Browse files
committed
test(): clean up bulkMembers tests and fix claim test isolation issue
- Simplified DirectPayments.bulkMembers.test.ts by removing unnecessary custom validator creation and using existing fixture mocks with proper withArgs configuration - Simplified UBIPool.bulkMembers.test.ts by removing custom validator creation in validation tests and using fixture mocks instead - Changed UBIPool uniqueness validation test to use signers[5-7] instead of signers[2-4] to avoid mock conflicts with other tests - Fixed DirectPayments.claim.test.ts "non member should not be able to get rewards" test by explicitly setting uniquenessValidator to AddressZero to prevent "Mock on the method is not initialized" error when running all tests together The claim test was failing when run with other tests because it inherited uniqueness validator mock state without proper initialization for the test's specific address. Setting uniquenessValidator to zero address ensures proper test isolation and bypasses uniqueness validation, which is appropriate since this test only validates member validation logic.
1 parent d00a17d commit 85c7ca5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/contracts/test/DirectPayments/DirectPayments.claim.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe('DirectPaymentsPool Claim', () => {
175175

176176
newMembersValidator.mock['isMemberValid'].returns(false);
177177

178-
await pool.setPoolSettings({ ...poolSettings, membersValidator: newMembersValidator.address }, 0);
178+
await pool.setPoolSettings({ ...poolSettings, membersValidator: newMembersValidator.address, uniquenessValidator: ethers.constants.AddressZero }, 0);
179179
await expect(pool['claim(uint256)'](nftSampleId)).not.reverted;
180180
const contributer = nftSample.events[0].contributers[0];
181181
const initialBalance = await gdframework.GoodDollar.balanceOf(contributer);

0 commit comments

Comments
 (0)