Skip to content

IS-11368 LWA: forward HaapiBaseFormField.required to rendered field inputs#200

Merged
aleixsuau merged 5 commits into
integration/IS-5161/login-web-appfrom
feature/IS-11368-required-attr-form-fields
May 27, 2026
Merged

IS-11368 LWA: forward HaapiBaseFormField.required to rendered field inputs#200
aleixsuau merged 5 commits into
integration/IS-5161/login-web-appfrom
feature/IS-11368-required-attr-form-fields

Conversation

@aleixsuau
Copy link
Copy Markdown
Contributor

@aleixsuau aleixsuau commented May 25, 2026

Jira: https://curity.atlassian.net/browse/IS-11368

Context

The HAAPI type HaapiBaseFormField carries an optional required?: boolean property (see ui-kit/src/login-web-app/src/haapi-stepper/data-access/types/haapi-form.types.ts, lines 66-77).

Today the four LWA visible-field components do not forward this to the underlying DOM element, so the browser never performs basic constraint validation and AT users do not receive the aria-required semantics implied by the HTML attribute.

This PR wires required through to the rendered input/select on the four visible-field components in the haapi-stepper.

Tests

New HTML required attribute describe block in HaapiStepperFormUI.spec.tsx covers:

  • field.required: true → DOM required is present on text, password, select, checkbox.
  • field.required: false → DOM required is absent.
  • field.required: undefined (omitted) → DOM required is absent.

Comment thread src/login-web-app/src/haapi-stepper/util/tests/mocks.ts Outdated
@vahag-curity
Copy link
Copy Markdown
Contributor

Acceptance-criteria conflict

The Jira ticket itself codifies the wrong semantics ("When field.required is falsy (undefined, false, 0, '', null), no required attribute is present").

aleixsuau added 2 commits May 26, 2026 14:34
Flip the runtime semantics from `!!field.required` to `field.required ?? true`
on the four visible field UIs (text, password, select, checkbox). Matches the
JSDoc on HaapiBaseFormField.required ("Defaults to true.") and reflects the
production reality that most LWA form fields are required.

Update HaapiStepperFormUI.spec.tsx to keep `createLoginFormAction()` mirroring
production (no `required: false` overrides) and instead fill the fields each
test actually needs to clear via per-field helpers (fillUsername, fillPassword,
selectCountry, checkRememberMe).
@aleixsuau
Copy link
Copy Markdown
Contributor Author

Acceptance-criteria conflict

The Jira ticket itself codifies the wrong semantics ("When field.required is falsy (undefined, false, 0, '', null), no required attribute is present").

Thanks for catching this, fixed ✅

@aleixsuau aleixsuau merged commit a4c4f2a into integration/IS-5161/login-web-app May 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants