From 2b0fcbbc334b46c814c9763ea5ded53ddd58b75e Mon Sep 17 00:00:00 2001 From: savor160 <8278328+savor160@users.noreply.github.com> Date: Sun, 15 Nov 2026 16:32:56 +0000 Subject: [PATCH] fix: use the correct i18n key for an empty group name (#9163) --- frontend/app/pages/register/index.test.ts | 25 +++++++++++++++++++++++ frontend/app/pages/register/index.vue | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/frontend/app/pages/register/index.test.ts b/frontend/app/pages/register/index.test.ts index 3a7818926..a2a27b2e1 100644 --- a/frontend/app/pages/register/index.test.ts +++ b/frontend/app/pages/register/index.test.ts @@ -99,3 +99,28 @@ describe("registration result handling", () => { expect(mocks.error).not.toHaveBeenCalled(); }); }); + +describe("group details", () => { + beforeEach(() => { + vi.stubGlobal("definePageMeta", vi.fn()); + vi.stubGlobal("useRouter", () => ({ push: mocks.push })); + }); + + afterEach(() => vi.unstubAllGlobals()); + + test("rejects a blank group name with the required field message", async () => { + const wrapper = mount({ ...RegistrationPage, render: () => null }); + const vm = wrapper.vm as unknown as { + groupDetails: { groupName: { value: string }; next: () => Promise }; + groupErrorMessages: string[]; + }; + try { + vm.groupDetails.groupName.value = " "; + await vm.groupDetails.next(); + expect(vm.groupErrorMessages).toEqual([i18n.global.t("validators.required")]); + } + finally { + wrapper.unmount(); + } + }); +}); diff --git a/frontend/app/pages/register/index.vue b/frontend/app/pages/register/index.vue index 10448aba8..4f6360db5 100644 --- a/frontend/app/pages/register/index.vue +++ b/frontend/app/pages/register/index.vue @@ -395,7 +395,7 @@ const { validate: validGroupName, valid: groupNameValid } = useAsyncValidator( ); async function validateGroup() { if (!groupName.value || !groupName.value.trim()) { - groupErrorMessages.value = [i18n.t("validation.required")]; + groupErrorMessages.value = [i18n.t("validators.required")]; return false; } groupErrorMessages.value = [];