Skip to content

Commit

Permalink
Updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChiaMineJP committed Sep 12, 2024
1 parent 146d8ca commit ccc17fa
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/gui/src/util/createOfferForIdsToOfferBuilderData.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,10 @@ describe('createOfferForIdsToOfferBuilderData', () => {
});
});
});
describe('when the amount is NaN', () => {
describe('when the amount is NaN (Non null)', () => {
it('should throw an error', () => {
const walletIdsAndAmounts = {
1: {},
1: NaN,
2: -1234,
};

Expand All @@ -211,6 +211,19 @@ describe('createOfferForIdsToOfferBuilderData', () => {
);
});
});
describe('when the amount is null', () => {
it('should throw an error', () => {
const walletIdsAndAmounts = {
1: {},
2: -1234,
};

// call to createOfferForIdsToOfferBuilderData should throw an error
expect(() => createOfferForIdsToOfferBuilderData(walletIdsAndAmounts as any, (() => {}) as any)).toThrow(
/Amount is not set for/,
);
});
});
describe('when the offered asset is for an unknown wallet type', () => {
it('should ignore the unknown wallet assets', () => {
const calledLookupByWalletIdWithIds: string[] = [];
Expand Down

0 comments on commit ccc17fa

Please sign in to comment.