Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erights committed May 24, 2022
1 parent 0e404a3 commit 6638155
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/wallet/api/test/test-lib-wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1243,6 +1243,7 @@ test('lib-wallet can give attestations in offers', async (/** @type {LibWalletTe
give: {
Attestation: AmountMath.make(attestationBrand, 30n),
},
multiples: 1n,
want: {},
},
{
Expand All @@ -1252,6 +1253,7 @@ test('lib-wallet can give attestations in offers', async (/** @type {LibWalletTe
give: {
Attestation: AmountMath.make(attestationBrand, 30n),
},
multiples: 1n,
want: {},
},
]);
Expand Down Expand Up @@ -1315,6 +1317,7 @@ test('lib-wallet can want attestations in offers', async (/** @type {LibWalletTe
want: {
Attestation: AmountMath.make(attestationBrand, 65n),
},
multiples: 1n,
give: {},
},
]);
Expand All @@ -1331,6 +1334,7 @@ test('lib-wallet can want attestations in offers', async (/** @type {LibWalletTe
give: {
Attestation: AmountMath.make(attestationBrand, 65n),
},
multiples: 1n,
want: {},
},
]);
Expand Down Expand Up @@ -1438,6 +1442,7 @@ test('addOffer invitationQuery', async (/** @type {LibWalletTestContext} */ t) =
value: 1n,
},
},
multiples: 1n,
exit: {
onDemand: null,
},
Expand Down Expand Up @@ -1559,6 +1564,7 @@ test('addOffer offer.invitation', async (/** @type {LibWalletTestContext} */ t)
value: 1n,
},
},
multiples: 1n,
exit: {
onDemand: null,
},
Expand Down
12 changes: 12 additions & 0 deletions packages/zoe/src/contractSupport/zoeHelpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,18 @@ export const assertProposalShape = (seat, expected) => {
assertKeys(actual.give, expected.give);
assertKeys(actual.want, expected.want);
assertKeys(actual.exit, expected.exit);
if ('multiples' in expected) {
// Not sure what else to test. Probably nothing until we convert all this
// to use proper patterns
} else {
// multiples other than 1n need to be opted into
assert(
actual.multiples === 1n,
X`Only 1n multiples expected: ${actual.multiples}`,
);
// Not sure what to do with the value of expected.multiples. Probably
// nothing until we convert all this to use proper patterns
}
};

/* Given a brand, assert that brand is AssetKind.NAT. */
Expand Down
2 changes: 2 additions & 0 deletions packages/zoe/test/unitTests/zcf/test-zcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,7 @@ test(`zcfSeat.getProposal from zcf.makeEmptySeatKit`, async t => {
},
give: {},
want: {},
multiples: 1n,
});
});

Expand Down Expand Up @@ -903,6 +904,7 @@ test(`userSeat.getProposal from zcf.makeEmptySeatKit`, async t => {
},
give: {},
want: {},
multiples: 1n,
});
});

Expand Down

0 comments on commit 6638155

Please sign in to comment.