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 = [];