Skip to content

Commit becafb7

Browse files
antoinnneeeclaude
andcommitted
test(e2e): demande d'ami par email au lieu de addresseeId
POST /friendships attend { email } (invitation par email) ; le test envoyait encore { addresseeId }, rejeté en 400 par forbidNonWhitelisted. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d3cf270 commit becafb7

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

backend/test/app.e2e-spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ describe('FloraPin API (e2e)', () => {
125125
expect(res.body.accessToken).toBeDefined();
126126
return {
127127
id: res.body.user.id as string,
128+
email,
128129
access: res.body.accessToken as string,
129130
refresh: res.body.refreshToken as string,
130131
};
@@ -265,7 +266,7 @@ describe('FloraPin API (e2e)', () => {
265266
const reqRes = await api()
266267
.post('/api/v1/friendships')
267268
.set('Authorization', `Bearer ${owner.access}`)
268-
.send({ addresseeId: friend.id })
269+
.send({ email: friend.email })
269270
.expect(201);
270271
await api()
271272
.post(`/api/v1/friendships/${reqRes.body.id}/accept`)
@@ -510,12 +511,12 @@ describe('FloraPin API (e2e)', () => {
510511
/** Crée une amitié acceptée entre [owner] et [friend]. */
511512
async function befriend(
512513
owner: { access: string },
513-
friend: { id: string; access: string },
514+
friend: { id: string; email: string; access: string },
514515
): Promise<void> {
515516
const reqRes = await api()
516517
.post('/api/v1/friendships')
517518
.set('Authorization', `Bearer ${owner.access}`)
518-
.send({ addresseeId: friend.id })
519+
.send({ email: friend.email })
519520
.expect(201);
520521
await api()
521522
.post(`/api/v1/friendships/${reqRes.body.id}/accept`)

0 commit comments

Comments
 (0)