diff --git a/packages/wallet/ui/src/components/Offer.jsx b/packages/wallet/ui/src/components/Offer.jsx index 53ee42036b1..a5e34f09907 100644 --- a/packages/wallet/ui/src/components/Offer.jsx +++ b/packages/wallet/ui/src/components/Offer.jsx @@ -20,6 +20,7 @@ const statusText = { complete: 'Accepted', pending: 'Pending', proposed: 'Proposed', + cancel: 'Cancelled', }; const statusColors = { @@ -29,6 +30,7 @@ const statusColors = { pending: 'warning', proposed: 'default', complete: 'success', + cancel: 'default', }; const cmp = (a, b) => { @@ -69,7 +71,7 @@ const OfferWithoutContext = ({ setPendingOffers({ offerId: id, isPending: true }); } - // Eagerly show pending and declined offers states. + // Eagerly show pending and declined offers' states. if (status === 'proposed' && pendingOffers.has(id)) { status = 'pending'; } @@ -192,17 +194,16 @@ const OfferWithoutContext = ({ ); + const isOfferCompleted = [ + 'accept', + 'decline', + 'complete', + 'rejected', + 'cancel', + ].includes(status); + return ( - + { rejectedOffer.status = 'rejected'; component = mount(); expect(component.find(Request).props().completed).toEqual(true); + + const cancelledOffer = { ...offer }; + cancelledOffer.status = 'cancel'; + component = mount(); + expect(component.find(Request).props().completed).toEqual(true); }); test('closes the offer', () => {