Skip to content

test: cover Switch, PasswordField and SearchField - #1330

Open
cookieark7 wants to merge 1 commit into
ClickHouse:mainfrom
cookieark7:test/switch-passwordfield-searchfield
Open

cookieark7 wants to merge 1 commit into
ClickHouse:mainfrom
cookieark7:test/switch-passwordfield-searchfield

Conversation

@cookieark7

@cookieark7 cookieark7 commented Nov 28, 2026 •

Copy link
Copy Markdown

Description

Add unit tests for three form components that had no test file:

  • Switch: accessible name from label, aria-checked, onCheckedChange, label click, disabled, custom id, ref and rest-prop forwarding.
  • PasswordField: masked input tied to its label, onChange(value, event), the visibility toggle (only shown once there is a value), disabled, ref and native attribute forwarding.
  • SearchField: search and filter icons, onChange, the clear button (default, clear={false}, disabled), focusing the input from the icon, ref forwarding.

Links and tickets

None.

Good to know

Tests only, no component code changed, so no changeset. While writing them I noticed Switch renders aria-label="undefined" when no label is passed. I left that out of this PR to keep it test-only.

Checklist

  • Breaking changes? (add migration notes in changesets)
  • Visual changes? (specify in changesets)
  • Design review needed?

Contribution

  • Sufficient research before PR
  • Self-reviewed the PR
  • Manually tested the changes (when applies - visual confirmation in Storybook)
  • build and build-storybook work locally
  • Tests and Stories are aligned with the changes

Accessibility

Skipped: no component markup, behavior or styles changed.

🤖 Generated with Claude Code

Add unit tests for three form components that had none: labelling,
controlled value and change handling, disabled state, ref forwarding,
the PasswordField visibility toggle and the SearchField icon and clear
button.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 72cf730

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This branch has not been deployed

No deployments
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.

1 participant