From 35ef205c0ff1a4bb6b08cf2226edf69eb8200ea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Sat, 16 May 2026 21:47:40 +0300 Subject: [PATCH] =?UTF-8?q?feat(auth):=20A4=20=E2=80=94=20ResetPassword=20?= =?UTF-8?q?=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0=20=D0=BD=D0=B5=D1=81=D0=BE?= =?UTF-8?q?=D0=B2=D0=BF=D0=B0=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=B0?= =?UTF-8?q?=D1=80=D0=BE=D0=BB=D0=B5=D0=B9=20(Sprint=205A)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/resources/js/views/auth/ResetPasswordView.vue | 12 ++++++++++++ app/tests/Frontend/ResetPasswordView.spec.ts | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/app/resources/js/views/auth/ResetPasswordView.vue b/app/resources/js/views/auth/ResetPasswordView.vue index 3113495d..d185285c 100644 --- a/app/resources/js/views/auth/ResetPasswordView.vue +++ b/app/resources/js/views/auth/ResetPasswordView.vue @@ -37,6 +37,17 @@ const canSubmit = computed( password.value === passwordConfirmation.value, ); +/** + * Ошибка поля подтверждения: client-side проверка совпадения + + * проброс backend-ошибки `password_confirmation` если придёт с 422. + */ +const confirmationError = computed(() => { + if (passwordConfirmation.value.length > 0 && password.value !== passwordConfirmation.value) { + return ['Пароли не совпадают']; + } + return errors.value.password_confirmation ?? []; +}); + async function handleSubmit() { errors.value = {}; try { @@ -115,6 +126,7 @@ async function handleSubmit() { variant="outlined" density="comfortable" required + :error-messages="confirmationError" /> { expect(alert.exists()).toBe(true); expect(alert.text()).toContain('10 мин'); }); + + it('A4: показывает ошибку при несовпадении пароля и подтверждения', async () => { + const wrapper = await mountReset(); + const pwInputs = wrapper.findAll('input[type="password"]'); + await pwInputs[0].setValue('new-strong-pass-1234'); + await pwInputs[1].setValue('different-pass-9999'); + await wrapper.vm.$nextTick(); + expect(wrapper.text()).toContain('Пароли не совпадают'); + }); });