Skip payment process if item is free to borrow
This commit is contained in:
@@ -295,6 +295,17 @@ describe('RefundService', () => {
|
||||
cancelledBy: null
|
||||
});
|
||||
});
|
||||
|
||||
it('should allow cancellation for free rental with not_required payment status', () => {
|
||||
const rental = { ...baseRental, paymentStatus: 'not_required' };
|
||||
const result = RefundService.validateCancellationEligibility(rental, 100);
|
||||
|
||||
expect(result).toEqual({
|
||||
canCancel: true,
|
||||
reason: 'Cancellation allowed',
|
||||
cancelledBy: 'renter'
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('Edge cases', () => {
|
||||
|
||||
Reference in New Issue
Block a user