From 7f849d116b217981ae91d590cbc6fb25c85d61f0 Mon Sep 17 00:00:00 2001 From: Laurent GAY Date: Fri, 27 Jun 2025 19:18:45 +0200 Subject: [PATCH] correct screen "participation without account" and adapt test - issue 1776 --- .../ParticipationWithoutAccount.vue | 2 +- .../ParticipationWithoutAccount.spec.ts | 6 ++--- .../ParticipationWithoutAccount.spec.ts.snap | 26 +++++++++++++++++++ tests/unit/specs/mocks/event.ts | 1 + 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/src/components/Participation/ParticipationWithoutAccount.vue b/src/components/Participation/ParticipationWithoutAccount.vue index 98a1ffdfb..c228a70da 100644 --- a/src/components/Participation/ParticipationWithoutAccount.vue +++ b/src/components/Participation/ParticipationWithoutAccount.vue @@ -270,7 +270,7 @@ const joinEvent = async (): Promise => { actorId: anonymousActorId.value, email: anonymousParticipation.email, message: anonymousParticipation.message, - locale: locale, + locale: locale.value, timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, }); }; diff --git a/tests/unit/specs/components/Participation/ParticipationWithoutAccount.spec.ts b/tests/unit/specs/components/Participation/ParticipationWithoutAccount.spec.ts index 7b3976836..1fb725574 100644 --- a/tests/unit/specs/components/Participation/ParticipationWithoutAccount.spec.ts +++ b/tests/unit/specs/components/Participation/ParticipationWithoutAccount.spec.ts @@ -141,7 +141,7 @@ describe("ParticipationWithoutAccount", () => { await flushPromises(); expect(requestHandlers.joinEventMutationHandler).toHaveBeenCalledWith( - expect.objectContaining(joinEventMock) + joinEventMock ); expect(wrapper.vm.error).toBe(false); @@ -220,7 +220,7 @@ describe("ParticipationWithoutAccount", () => { await flushPromises(); expect(requestHandlers.joinEventMutationHandler).toHaveBeenCalledWith( - expect.objectContaining(joinEventMock) + joinEventMock ); expect(wrapper.vm.error).toBe(false); @@ -265,7 +265,7 @@ describe("ParticipationWithoutAccount", () => { await flushPromises(); expect(requestHandlers.joinEventMutationHandler).toHaveBeenCalledWith( - expect.objectContaining(joinEventMock) + joinEventMock ); await flushPromises(); expect(wrapper.find("form").exists()).toBeTruthy(); diff --git a/tests/unit/specs/components/Participation/__snapshots__/ParticipationWithoutAccount.spec.ts.snap b/tests/unit/specs/components/Participation/__snapshots__/ParticipationWithoutAccount.spec.ts.snap index 5ddd3a8ee..687ade13d 100644 --- a/tests/unit/specs/components/Participation/__snapshots__/ParticipationWithoutAccount.spec.ts.snap +++ b/tests/unit/specs/components/Participation/__snapshots__/ParticipationWithoutAccount.spec.ts.snap @@ -64,3 +64,29 @@ exports[`ParticipationWithoutAccount > handles being already a participant 1`] = " `; + +exports[`ParticipationWithoutAccount > renders the participation without account view with minimal data 1`] = ` +"
+
+
+

Request for participation confirmation sent

+

Check your inbox (and your junk mail folder).Your participation will be validated once you click the confirmation link into the email.

+ +

You may now close this window, or return to the event's page.

+
+
+
" +`; + +exports[`ParticipationWithoutAccount > renders the warning if the event participation is restricted 1`] = ` +"
+
+
+

Request for participation confirmation sent

+

Check your inbox (and your junk mail folder).Your participation will be validated once you click the confirmation link into the email, and after the organizer manually validates your participation.

+ +

You may now close this window, or return to the event's page.

+
+
+
" +`; diff --git a/tests/unit/specs/mocks/event.ts b/tests/unit/specs/mocks/event.ts index 4e6ceac8e..206794746 100644 --- a/tests/unit/specs/mocks/event.ts +++ b/tests/unit/specs/mocks/event.ts @@ -56,6 +56,7 @@ export const joinEventMock = { actorId: "1", email: "some@email.tld", message: "a message long enough", + locale: "en_US", timezone: Intl.DateTimeFormat().resolvedOptions().timeZone, };