changed field from availability to isAvailable
This commit is contained in:
@@ -422,8 +422,8 @@ describe('Items Routes', () => {
|
||||
|
||||
describe('GET /recommendations', () => {
|
||||
const mockRecommendations = [
|
||||
{ id: 1, name: 'Item 1', availability: true },
|
||||
{ id: 2, name: 'Item 2', availability: true }
|
||||
{ id: 1, name: 'Item 1', isAvailable: true },
|
||||
{ id: 2, name: 'Item 2', isAvailable: true }
|
||||
];
|
||||
|
||||
it('should get recommendations for authenticated user', async () => {
|
||||
@@ -443,7 +443,7 @@ describe('Items Routes', () => {
|
||||
});
|
||||
|
||||
expect(mockItemFindAll).toHaveBeenCalledWith({
|
||||
where: { availability: true },
|
||||
where: { isAvailable: true, isDeleted: false },
|
||||
limit: 10,
|
||||
order: [['createdAt', 'DESC']]
|
||||
});
|
||||
|
||||
@@ -260,7 +260,7 @@ describe('Rentals Routes', () => {
|
||||
id: 1,
|
||||
name: 'Test Item',
|
||||
ownerId: 2,
|
||||
availability: true,
|
||||
isAvailable: true,
|
||||
pricePerHour: 10,
|
||||
pricePerDay: 50,
|
||||
};
|
||||
@@ -340,7 +340,7 @@ describe('Rentals Routes', () => {
|
||||
});
|
||||
|
||||
it('should return 400 for unavailable item', async () => {
|
||||
Item.findByPk.mockResolvedValue({ ...mockItem, availability: false });
|
||||
Item.findByPk.mockResolvedValue({ ...mockItem, isAvailable: false });
|
||||
|
||||
const response = await request(app)
|
||||
.post('/rentals')
|
||||
@@ -382,7 +382,7 @@ describe('Rentals Routes', () => {
|
||||
Item.findByPk.mockResolvedValue({
|
||||
id: 1,
|
||||
ownerId: 2,
|
||||
availability: true,
|
||||
isAvailable: true,
|
||||
pricePerHour: 0,
|
||||
pricePerDay: 0
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user