Skip to content

Commit

Permalink
Update booking.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Feb 18, 2024
1 parent 7a0a1d8 commit 4418ca1
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions api/tests/booking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ describe('POST /api/create-booking', () => {

describe('POST /api/checkout', () => {
it('should checkout', async () => {
const token = await TestHelper.signinAsUser()

let bookings = await Booking.find({ renter: USER_ID })
expect(bookings.length).toBe(1)

Expand All @@ -144,15 +142,12 @@ describe('POST /api/checkout', () => {

const res = await request(app)
.post('/api/checkout')
.set(env.X_ACCESS_TOKEN, token)
.send(payload)

bookings = await Booking.find({ renter: USER_ID })
expect(bookings.length).toBeGreaterThan(1)

expect(res.statusCode).toBe(200)

await TestHelper.signout(token)
bookings = await Booking.find({ renter: USER_ID })
expect(bookings.length).toBeGreaterThan(1)
})
})

Expand Down

0 comments on commit 4418ca1

Please sign in to comment.