Skip to content

Fixes #39511 - Replace enzyme test in SearchInput with RTL#11094

Open
kfamilonidis wants to merge 1 commit into
theforeman:developfrom
kfamilonidis:pf5-search-input
Open

Fixes #39511 - Replace enzyme test in SearchInput with RTL#11094
kfamilonidis wants to merge 1 commit into
theforeman:developfrom
kfamilonidis:pf5-search-input

Conversation

@kfamilonidis

@kfamilonidis kfamilonidis commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

The three tests now verify real user-visible behavior (value, class, Clear button presence, focus state) +1 the Clear button behaviour onClick event that it was not previously tested.

@Lukshio

Lukshio commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Clean, focused enzyme->RTL migration for SearchInput. The three tests now verify real user-visible behavior (value, class, Clear button presence, focus state) instead of a snapshot. No functional concerns.

Critical (must fix before merge)

  • None

Suggestions (should fix)

  • Commit message uses Fixes #39511: ... - the documented Foreman convention (and what's used on develop, e.g. Fixes #38653 - Fix settings show endpoint) is Fixes #XXXXX - description with a hyphen, not a colon. Please reformat.
  • The Clear button is only checked for presence (toBeInTheDocument), not behavior. Since RTL makes it easy, consider adding an interaction test with userEvent.click to verify clearing actually works (the old snapshot never covered this either, so it would be a net improvement).

Nice to have (optional)

  • @testing-library/jest-dom is imported per-file here; worth double-checking whether Foreman's global Jest setup already extends expect with jest-dom matchers, in which case this import is redundant.

Checklist gaps

  • PR description is just the commit title repeated - a short note on what behavior the new tests cover would help reviewers.

@kfamilonidis kfamilonidis changed the title Fixes #39511: Replace enzyme test in SearchInput with RTL Fixes #39511 - Replace enzyme test in SearchInput with RTL Jul 14, 2026
@kfamilonidis

kfamilonidis commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@Lukshio I added a test to onClear event

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants