From b313555ebe4f951c88a3c343147ca826df3a3c4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Wed, 10 Jan 2024 12:36:41 +0100 Subject: [PATCH] MOBILE-3947 signup: Fix input error default set --- .../components/input-errors/input-errors.ts | 20 ++++++++++--------- .../features/login/tests/behat/signup.feature | 1 - 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/core/components/input-errors/input-errors.ts b/src/core/components/input-errors/input-errors.ts index 570386555..b43c55cdd 100644 --- a/src/core/components/input-errors/input-errors.ts +++ b/src/core/components/input-errors/input-errors.ts @@ -64,17 +64,19 @@ export class CoreInputErrorsComponent implements OnInit, OnChanges { * Initialize some common errors if they aren't set. */ protected initErrorMessages(): void { + // Set default error messages. this.errorMessages = { - required: this.errorMessages.required || 'core.required', - email: this.errorMessages.email || 'core.login.invalidemail', - date: this.errorMessages.date || 'core.login.invaliddate', - datetime: this.errorMessages.datetime || 'core.login.invaliddate', - datetimelocal: this.errorMessages.datetimelocal || 'core.login.invaliddate', - time: this.errorMessages.time || 'core.login.invalidtime', - url: this.errorMessages.url || 'core.login.invalidurl', + required: 'core.required', + email: 'core.login.invalidemail', + date: 'core.login.invaliddate', + datetime: 'core.login.invaliddate', + datetimelocal: 'core.login.invaliddate', + time: 'core.login.invalidtime', + url: 'core.login.invalidurl', // Set empty values by default, the default error messages will be built in the template when needed. - max: this.errorMessages.max || '', - min: this.errorMessages.min || '', + max: '', + min: '', + ...this.errorMessages, }; this.errorMessages.requiredTrue = this.errorMessages.required; diff --git a/src/core/features/login/tests/behat/signup.feature b/src/core/features/login/tests/behat/signup.feature index 69db46ad7..eb277a005 100755 --- a/src/core/features/login/tests/behat/signup.feature +++ b/src/core/features/login/tests/behat/signup.feature @@ -18,7 +18,6 @@ Feature: Test signup in app And I should find "These are the authentication instructions." in the app But I should not find "Create new account" in the app - @ionic7_failure Scenario: Basic signup When I launch the app