removed cron job that made rentals active. Now whether or not the rental is active is determined on the fly
This commit is contained in:
@@ -27,11 +27,15 @@ describe('DamageAssessmentService', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
// Reset mockRental for each test to avoid state pollution
|
||||
// Active status is computed: confirmed + startDateTime in the past
|
||||
const pastDate = new Date();
|
||||
pastDate.setHours(pastDate.getHours() - 1); // 1 hour ago
|
||||
mockRental = {
|
||||
id: 'rental-123',
|
||||
ownerId: 'owner-789',
|
||||
renterId: 'renter-456',
|
||||
status: 'active',
|
||||
status: 'confirmed',
|
||||
startDateTime: pastDate,
|
||||
item: { name: 'Test Camera', dailyRate: 100 },
|
||||
update: jest.fn().mockResolvedValue({
|
||||
id: 'rental-123',
|
||||
|
||||
Reference in New Issue
Block a user