From 4c46f115f5f006b5e595d70bade048f053851152 Mon Sep 17 00:00:00 2001 From: Daniel Hutzel Date: Sun, 19 May 2024 10:53:14 +0200 Subject: [PATCH] Corrected tests --- test/custom-handlers.test.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/custom-handlers.test.js b/test/custom-handlers.test.js index e4cebccd..e0d54c3c 100644 --- a/test/custom-handlers.test.js +++ b/test/custom-handlers.test.js @@ -8,9 +8,10 @@ describe('cap/samples - Custom Handlers', () => { }) it('should reject out-of-stock orders', async () => { - await POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}` - await POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}` - await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.rejectedWith(/409 - 5 exceeds stock for book #201/) + await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.fulfilled + await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.fulfilled + await expect(POST `/browse/submitOrder ${{ book: 201, quantity: 5 }}`).to.be.rejectedWith( + /409 - 5 exceeds stock for book #201/) const { data } = await GET`/admin/Books/201/stock/$value` expect(data).to.equal(2) })