diff --git a/backend/src/__tests__/offers.test.js b/backend/src/__tests__/offers.test.js index 96dece7..508b18f 100644 --- a/backend/src/__tests__/offers.test.js +++ b/backend/src/__tests__/offers.test.js @@ -127,4 +127,40 @@ test('POST /offers/negotiation/:offerId should return 400 for message exceeding } }); assert.strictEqual(response.statusCode, 400); +}); + +// Test for missing authentication +test('POST /offers/:requestId should return 401 for unauthenticated request', async () => { + const response = await app.inject({ + method: 'POST', + url: '/offers/1', + payload: { + amountChf: 50, + message: 'I can help with this' + } + }); + assert.strictEqual(response.statusCode, 401); +}); + +// Test for missing authentication in negotiation +test('POST /offers/negotiation/:offerId should return 401 for unauthenticated request', async () => { + const response = await app.inject({ + method: 'POST', + url: '/offers/negotiation/1', + payload: { + amountChf: 60, + message: 'What about this amount?' + } + }); + assert.strictEqual(response.statusCode, 401); +}); + +// Test for missing authentication in accept +test('POST /offers/accept/:offerId should return 401 for unauthenticated request', async () => { + const response = await app.inject({ + method: 'POST', + url: '/offers/accept/1', + payload: {} + }); + assert.strictEqual(response.statusCode, 401); }); \ No newline at end of file diff --git a/docs/runtime/pick_next_task_state.env b/docs/runtime/pick_next_task_state.env index 36f98bd..047ac62 100644 --- a/docs/runtime/pick_next_task_state.env +++ b/docs/runtime/pick_next_task_state.env @@ -1,2 +1,2 @@ -LAST_ROUTE=helpRequests.js -UPDATED_AT=2026-03-06T20:33:06Z +LAST_ROUTE=offers.js +UPDATED_AT=2026-03-06T20:34:06Z