From eab65ce0bd1e6d2ee8c064c311d9b70ff84c6338 Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Mon, 23 Sep 2024 21:42:33 -0500 Subject: [PATCH] Update tests for any contains BW addresses --- .../src/lib/addresses/spec/addressesContainsAny.spec.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/spec/addressesContainsAny.spec.ts b/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/spec/addressesContainsAny.spec.ts index e445e56f7f..609a5f8e4f 100644 --- a/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/spec/addressesContainsAny.spec.ts +++ b/packages/protocol/packages/boundwitness/packages/validator/src/lib/addresses/spec/addressesContainsAny.spec.ts @@ -19,7 +19,7 @@ describe('addressesContainsAny', () => { } describe('returns true', () => { const cases: [string, () => WalletInstance[]][] = [ - ['with no wallets', () => []], + // ['with no wallets', () => []], ['with single wallet', () => oneWallet], ['with multiple wallets', () => twoWallets], ] @@ -34,22 +34,23 @@ describe('addressesContainsAny', () => { }) it('with all wallets as signers and all wallet addresses supplied', async () => { const bw = await buildBoundWitness(wallets()) - expect(addressesContainsAny(bw, addresses)).toBe(wallets().length > 0) // Should be true if wallets exist + expect(addressesContainsAny(bw, addresses)).toBeTrue() // Should be true if wallets exist }) it('with all wallets (and extra wallets) as signers and all wallet addresses supplied', async () => { const extraSigners = [...wallets(), await HDWallet.random()] const bw = await buildBoundWitness(extraSigners) - expect(addressesContainsAny(bw, addresses)).toBe(wallets().length > 0) // Should still be true with extras + expect(addressesContainsAny(bw, addresses)).toBeTrue() // Should still be true with extras }) it('with only one matching signer', async () => { const extraSigners = [await HDWallet.random(), ...wallets()] const bw = await buildBoundWitness(extraSigners) - expect(addressesContainsAny(bw, addresses)).toBe(wallets().length > 0) // Should return true with one match + expect(addressesContainsAny(bw, addresses)).toBeTrue() // Should return true with one match }) }) }) describe('returns false', () => { const cases: [string, () => WalletInstance[]][] = [ + ['with no wallets', () => []], ['with single wallet', () => oneWallet], ['with multiple wallets', () => twoWallets], ]