Skip to content

fix(dashboard): Register error prop pasa '' a MUI TextField (card 9151895a) - #218

Open
SabaTech-dev wants to merge 1 commit into
mainfrom
fix/register-error-string
Open

fix(dashboard): Register error prop pasa '' a MUI TextField (card 9151895a)#218
SabaTech-dev wants to merge 1 commit into
mainfrom
fix/register-error-string

Conversation

@SabaTech-dev

Copy link
Copy Markdown
Owner

Card

Workboard card 9151895a-5745-4a0d-af3b-f439a564db9e (flujo corto QA-FW). Bug preexistente en main, detectado por el QA gate del PR #212. Este PR NO toca la branch del PR #212 (feat/frontend-major-upgrades): sale de origin/main.

Problema

Register.tsx:178 pasaba error={formData.confirmPassword && formData.password !== formData.confirmPassword} a MUI TextField/FormControl. Con confirmPassword vacio la expresion && evalua a '' (string), no a false — pitfall clasico de JSX. MUI espera boolean y emite en desarrollo:

Warning: Failed prop type: Invalid prop `error` of type `string` supplied to `ForwardRef(TextField)`, expected `boolean`.

(El warning se reproduce tanto en MUI 5 de main como se agrava con la subida a MUI 9 del PR #212.)

Fix

Envuelto en Boolean(...) — unica ocurrencia del patron en el archivo (verificado con grep sobre todo el frontend).

Tests (TDD: RED -> GREEN)

Nuevo Register.test.tsx (vitest + RTL, 3 tests):

  1. Captura del propTypes warning con spy sobre console.error — ojo: React 18 emite el warning printf-style ('Warning: Failed %s type: %s%s'), el texto util va en argumentos secundarios, y React deduplica estos warnings por componente, por lo que el test renderiza primero.
  2. Mismatch password/confirm muestra el helper "Passwords do not match" (caracterizacion: el fix no debe perder la senal de error).
  3. Passwords coincidentes no muestran error.

Verificado RED (test 1 falla con el bug presente) antes de aplicar el fix; GREEN despues.

Verificacion

…1895a)

error={confirmPassword && ...} evalua a '' (string) cuando confirmPassword
esta vacio; MUI FormControl/TextField espera boolean y emite
'Invalid prop `error` of type `string`' en desarrollo. Envuelto en
Boolean(...). Anadidos tests vitest+RTL: captura del propTypes warning
via spy de console.error (printf-style, texto en args secundarios),
mismatch muestra helper y match no muestra error.

Card: 9151895a-5745-4a0d-af3b-f439a564db9e
@SabaTech-dev SabaTech-dev added the bug Something isn't working label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

PR Check Results

Code Formatting: Passed
Linting: Passed
Type Checking: Failed
Tests: Failed

⚠️ Some checks failed. Please review the details above.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

⚠️ WARN Trivy Security Scan Results

Severity Count
🔴 CRITICAL 0
🟠 HIGH 47
Total 47

Scans performed:

  • 📁 Filesystem (vulnerabilities, secrets, misconfigurations)
  • 🐳 Backend Docker image
  • 🐳 Frontend Docker image
  • 🏗️ IaC misconfiguration detection

⚠️ HIGH vulnerabilities should be addressed. Review required.

📋 View detailed SARIF reports

Download artifacts from this workflow run for full SARIF reports.
Results are also available in the GitHub Security tab.


Trivy v0.71.0 | aquasecurity/trivy

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🎨 Frontend Preview Deployment

App Coolify: qa-framework-frontend-pr-218 (0jvzbjv2uzswlilwgovmqfqb)
Estado: ⚠️ running:unknown
Commit: fac0e8963971cd67b4e3cb0f0771115feab8d3ad
Branch: fix/register-error-string

Preview interna (sin FQDN público hasta decisión de proxy — card 52a85645).

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown

🔧 Backend Preview Deployment

App Coolify: qa-framework-backend-pr-218 (dohs0iejsuwc5sw453qu9sq6)
Estado: ⚠️ running:unknown
Commit: fac0e8963971cd67b4e3cb0f0771115feab8d3ad
Branch: fix/register-error-string

Preview interna (sin FQDN público hasta decisión de proxy — card 52a85645).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant